diff options
Diffstat (limited to 'nvim/lua/plugins/nvim-cmp.lua')
| -rw-r--r-- | nvim/lua/plugins/nvim-cmp.lua | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/nvim/lua/plugins/nvim-cmp.lua b/nvim/lua/plugins/nvim-cmp.lua deleted file mode 100644 index b7d71a3..0000000 --- a/nvim/lua/plugins/nvim-cmp.lua +++ /dev/null @@ -1,64 +0,0 @@ -local config = function() - local cmp = require("cmp") - vim.opt.completeopt = "menu,menuone" - - cmp.setup({ - formatting = { - expandable_indicator = false, - fields = { "abbr", "kind" }, - format = require("lspkind").cmp_format({ - mode = "text_symbol", - maxwidth = function() return math.floor(0.45 * vim.o.columns) end, - ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) - before = function(_, vim_item) - vim_item.menu = "" - return vim_item - end - }) - }, - snippet = { - expand = function(args) - vim.snippet.expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = { - ["<TAB>"] = cmp.mapping.select_next_item(), - ["<C-b>"] = cmp.mapping.scroll_docs(-4), - ["<C-f>"] = cmp.mapping.scroll_docs(4), - ["<C-Space>"] = cmp.mapping.complete(), - ["<C-e>"] = cmp.mapping.abort(), - ["<CR>"] = cmp.mapping.confirm({ select = true }), - }, - sources = cmp.config.sources( - { - { name = "lazydev", group_index = 0 } - }, { - { name = "neorg" } - }, { - { name = "nvim_lsp" }, - }, { - { name = "path" }, - }, { - { name = "buffer" }, - } - ) - }) -end - -return { - "hrsh7th/nvim-cmp", - lazy = true, - event = "InsertEnter", - config = config, - dependencies = { - "neovim/nvim-lspconfig", - "onsails/lspkind.nvim", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - }, -} |
