mirror of
https://github.com/don-philipe/dotfiles.git
synced 2025-11-08 22:57:03 +01:00
Add neovim config with some plugins
This commit is contained in:
27
.config/nvim/lua/config/cmp.lua
Normal file
27
.config/nvim/lua/config/cmp.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
-- autocompletion
|
||||
local cmp = require('cmp')
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{name = 'nvim_lsp'},
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- Navigate between completion items
|
||||
['<C-p>'] = cmp.mapping.select_prev_item({behavior = 'select'}),
|
||||
['<C-n>'] = cmp.mapping.select_next_item({behavior = 'select'}),
|
||||
|
||||
-- `Enter` key to confirm completion
|
||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||
|
||||
-- Ctrl+Space to trigger completion menu
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
|
||||
-- Scroll up and down in the completion documentation
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
}),
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.snippet.expand(args.body)
|
||||
end,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user