From b491f9e3a73367dfd54ca8f8bc74008332c80f34 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Mon, 8 Jul 2024 01:13:30 +0300 Subject: Neovim: reworked most of the completion stuff, 80% done, will continue tmr --- .../nvim/lua/custom/plugins/TODO-completion.lua | 53 +++++----------------- 1 file changed, 11 insertions(+), 42 deletions(-) (limited to '.config/nvim/lua/custom/plugins') diff --git a/.config/nvim/lua/custom/plugins/TODO-completion.lua b/.config/nvim/lua/custom/plugins/TODO-completion.lua index 0699e9b..3f0ba3e 100644 --- a/.config/nvim/lua/custom/plugins/TODO-completion.lua +++ b/.config/nvim/lua/custom/plugins/TODO-completion.lua @@ -1,50 +1,19 @@ return { { - 'hrsh7th/cmp-nvim-lsp', - }, - { - 'L3MON4D3/LuaSnip', + 'hrsh7th/nvim-cmp', + lazy = false, + priority = 100, dependencies = { - 'saadparwaiz1/cmp_luasnip', - 'rafamadriz/friendly-snippets', + -- 'onsails/lspkind.nvim', + -- 'hrsh7th/cmp-path', + -- 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-nvim-lsp', -- lsp source for nvim-cmp + 'saadparwaiz1/cmp_luasnip', -- snippets source for nvim-cmp + { 'L3MON4D3/LuaSnip', build = 'make install_jsregexp' }, -- snippets plugin }, - }, - { - 'hrsh7th/nvim-cmp', - opts = function(_, opts) - -- Setup options for lazydev.nvim - opts.sources = opts.sources or {} - table.insert(opts.sources, { - name = 'lazydev', - group_index = 0, - }) - end, + -- TODO: Move to setup opts config = function() - local cmp = require('cmp') - require('luasnip.loaders.from_vscode').lazy_load() - - cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, { { name = 'buffer' } }), - }) + require('custom.completion') end, }, } -- cgit v1.3.1