dotfiles/symlinks/config/nvim/lua/lsp/completion.lua

28 lines
780 B
Lua
Raw Normal View History

2021-02-23 11:27:32 +00:00
-------------------------------------------------------------------------------
-- - LSP completion config -
-------------------------------------------------------------------------------
-- Set completeopt to have a better completion experience
2021-10-08 14:28:07 +00:00
vim.o.completeopt = "menu,menuone,noselect"
2021-03-23 10:54:28 +00:00
2021-10-08 14:28:07 +00:00
local cmp = require'cmp'
cmp.setup {
snippet = {
expand = function(args)
vim.fn["UltiSnips#Anon"](args.body)
end,
},
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'ultisnips' },
{ name = 'buffer' },
}
2021-03-23 10:54:28 +00:00
}