diff --git a/dot_config/nvim/lua/plugins/disabled.lua b/dot_config/nvim/lua/plugins/disabled.lua index 857558d..7b3bef6 100644 --- a/dot_config/nvim/lua/plugins/disabled.lua +++ b/dot_config/nvim/lua/plugins/disabled.lua @@ -2,7 +2,7 @@ return { { "williamboman/mason-lspconfig.nvim", enabled = false }, { "williamboman/mason.nvim", enabled = false }, { "jay-babu/mason-nvim-dap.nvim", enabled = false }, - { "mfusenegger/nvim-dap-python", enabled = false }, + -- { "mfusenegger/nvim-dap-python", enabled = false }, { "catppuccin/nvim", enabled = false }, { "folke/tokyonight.nvim", enabled = false }, } diff --git a/dot_config/nvim/lua/plugins/nvim-cmp_config.lua b/dot_config/nvim/lua/plugins/nvim-cmp_config.lua index db020c4..3b03f13 100644 --- a/dot_config/nvim/lua/plugins/nvim-cmp_config.lua +++ b/dot_config/nvim/lua/plugins/nvim-cmp_config.lua @@ -1,8 +1,28 @@ return { "hrsh7th/nvim-cmp", dependencies = { - "hrsh7th/cmp-cmdline" + "amarz45/nvim-cmp-buffer-lines", + "chrisgrieser/cmp_yanky", + "delphinus/cmp-ctags", + "Dosx001/cmp-commit", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-calc", + "hrsh7th/cmp-nvim-lsp-signature-help", + "hrsh7th/cmp-nvim-lsp-document-symbol", + "hrsh7th/cmp-cmdline", + "KadoBOT/cmp-plugins", + "lukas-reineke/cmp-rg", + "micangl/cmp-vimtex", + "petertriho/cmp-git", + "rasulomaroff/cmp-bufname", + "ray-x/cmp-treesitter", + "rcarriga/cmp-dap", + "tamago324/cmp-zsh" }, + enabled = function() + return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt" + or require("cmp_dap").is_dap_buffer() + end, opts = function(_, opts) local cmp = require("cmp") @@ -17,36 +37,6 @@ return { local lspkind = require("lspkind") - opts.formatting = vim.tbl_extend("force", opts.formatting, { - fields = { "abbr", "kind", "menu" }, - format = lspkind.cmp_format({ - mode = "symbol_text", -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters - ellipsis_char = "...", -- the truncated part when popup menu exceed maxwidth - before = function(entry, item) - local menu_icon = { - nvim_lsp = "", - vsnip = "", - path = "", - cmp_zotcite = "z", - cmp_r = "R", - } - item.menu = menu_icon[entry.source.name] - return item - end, - }), - }) - - --opts.snippet = vim.tbl_extend("force", opts.snippet, { - -- expand = function(args) - -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - -- end, - --}) - - -- opts.window = vim.tbl_extend("force", opts.window, { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - -- }) opts.mapping = vim.tbl_extend("force", opts.mapping, { [""] = cmp.mapping.abort(), @@ -84,23 +74,40 @@ return { c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), }), }) - -- opts.sources = cmp.config.sources({ - -- { name = "nvim_lsp" }, - -- { name = "vsnip" }, - -- { name = "cmp_r" }, - -- { name = "buffer" }, - -- { name = "path" }, - -- { name = "tmux" }, - -- }) + + opts.sources = opts.sources or {} + table.insert( + opts.sources, + { + -- { name = "buffer-lines" }, + { name = "bufname" }, + { name = "calc" }, + { name = "cmp_yanky" }, + { name = "ctags" }, + { name = "nvim_lsp_signature_help"}, + { name = "nvim_lsp_signature_help"}, + { name = "nvim_lua" }, + { name = "rg" }, + { name = "vimtex" }, + { name = "zsh" } + } + ) -- Set configuration for git. cmp.setup.filetype("gitcommit", { sources = cmp.config.sources({ { name = "cmp_git" }, + { name = "commit" }, { name = "buffer" }, }), }) + cmp.setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, { + sources = { + { name = "dap" }, + }, + }) + -- -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -- cmp.setup.cmdline({ "/", "?" }, { -- mapping = cmp.mapping.preset.cmdline(), diff --git a/dot_config/nvim/lua/plugins/nvim-dap-python.lua b/dot_config/nvim/lua/plugins/nvim-dap-python.lua new file mode 100644 index 0000000..a4e7c47 --- /dev/null +++ b/dot_config/nvim/lua/plugins/nvim-dap-python.lua @@ -0,0 +1,6 @@ +return { + "mfussenegger/nvim-dap-python", + config = function() + require("dap-python").setup("python3") + end +}