diff options
| author | Joe <rrbo@proton.me> | 2023-09-29 10:25:59 +0200 | 
|---|---|---|
| committer | Joe <rrbo@proton.me> | 2023-09-29 10:25:59 +0200 | 
| commit | 3eb89471c4b46521b069de9acd16d23dba886d81 (patch) | |
| tree | 2f6ff0688391f0c696a585152880dfa817027ca6 /.config/nvim/after/plugin | |
| parent | up (diff) | |
| download | dotfiles-bsd-3eb89471c4b46521b069de9acd16d23dba886d81.tar.gz dotfiles-bsd-3eb89471c4b46521b069de9acd16d23dba886d81.tar.bz2 dotfiles-bsd-3eb89471c4b46521b069de9acd16d23dba886d81.tar.xz dotfiles-bsd-3eb89471c4b46521b069de9acd16d23dba886d81.tar.zst dotfiles-bsd-3eb89471c4b46521b069de9acd16d23dba886d81.zip | |
good complete
Diffstat (limited to '')
| -rw-r--r-- | .config/nvim/after/plugin/lsp.lua | 57 | 
1 files changed, 53 insertions, 4 deletions
| diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 227e2eb..1056274 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -40,11 +40,60 @@ require('mason-lspconfig').setup({  local cmp = require('cmp')  local cmp_select = { behavior = cmp.SelectBehavior.Select } +cmp.setup({ +	window = { +		-- completion = cmp.config.window.bordered(), +		-- documentation = cmp.config.window.bordered(), +	}, +	mapping = cmp.mapping.preset.insert({ +		['<C-i>'] = cmp.mapping.select_next_item(cmp_select), +		['<C-j>'] = cmp.mapping.select_next_item(cmp_select), +		['<C-k>'] = cmp.mapping.select_prev_item(cmp_select), +		['<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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. +	}), +	sources = cmp.config.sources({ +		{ name = 'nvim_lsp' }, +		{ name = 'vsnip' }, -- For vsnip users. +		-- { name = 'luasnip' }, -- For luasnip users. +		-- { name = 'ultisnips' }, -- For ultisnips users. +		-- { name = 'snippy' }, -- For snippy users. +	}, { +		{ name = 'buffer' }, +	}) +}) + +  -- Set configuration for specific filetype. +  cmp.setup.filetype('gitcommit', { +    sources = cmp.config.sources({ +      { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). +    }, { +      { name = 'buffer' }, +    }) +  }) + +  -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). +  cmp.setup.cmdline({ '/', '?' }, { +    mapping = cmp.mapping.preset.cmdline(), +    sources = { +      { name = 'buffer' } +    } +  }) + +  -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +  cmp.setup.cmdline(':', { +    mapping = cmp.mapping.preset.cmdline(), +    sources = cmp.config.sources({ +      { name = 'path' } +    }, { +      { name = 'cmdline' } +    }) +  }) +  local cmp_mappings = lsp.defaults.cmp_mappings({ -	['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), -	['<C-n>'] = cmp.mapping.select_next_item(cmp_select), -	['<C-n>'] = cmp.mapping.confirm({ select = true }), -	['<C-Space>'] = cmp.mapping.complete(),  }) | 
