Update laptop nvim conf
This commit is contained in:
@@ -10,11 +10,24 @@ for _, lsp in ipairs(servers) do
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
local luasnip = require 'luasnip'
|
||||
local cmp = require 'cmp'
|
||||
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
preselect = cmp.PreselectMode.None,
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
@@ -32,6 +45,7 @@ cmp.setup {
|
||||
}),
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'path' }
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user