set base cmp config
This commit is contained in:
parent
0e48d46372
commit
65fb85fa90
1 changed files with 32 additions and 0 deletions
|
@ -26,6 +26,38 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local cmp = require('cmp')
|
||||||
|
cmp.setup({
|
||||||
|
sources = {
|
||||||
|
{name = 'nvim_lsp'},
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<C-y>'] = cmp.mapping.confirm({select = false}),
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<Up>'] = cmp.mapping.select_prev_item({behavior = 'select'}),
|
||||||
|
['<Down>'] = cmp.mapping.select_next_item({behavior = 'select'}),
|
||||||
|
['<C-p>'] = cmp.mapping(function()
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item({behavior = 'insert'})
|
||||||
|
else
|
||||||
|
cmp.complete()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
['<C-n>'] = cmp.mapping(function()
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item({behavior = 'insert'})
|
||||||
|
else
|
||||||
|
cmp.complete()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
},
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue