50 lines
1.2 KiB
Lua
50 lines
1.2 KiB
Lua
return {
|
|
-- nvim-cmp
|
|
{ 'dcampos/nvim-snippy' },
|
|
{
|
|
'hrsh7th/nvim-cmp',
|
|
dependencies = {
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
'hrsh7th/cmp-path',
|
|
'hrsh7th/cmp-buffer',
|
|
'dcampos/cmp-snippy'
|
|
},
|
|
lazy = false,
|
|
config = function()
|
|
local cmp = require'cmp'
|
|
|
|
cmp.setup({
|
|
snippet = {
|
|
-- REQUIRED - you must specify a snippet engine
|
|
expand = function(args)
|
|
require'snippy'.expand_snippet(args.body)
|
|
end,
|
|
},
|
|
mapping = {
|
|
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
|
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
|
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
|
-- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
|
['<C-y>'] = cmp.config.disable,
|
|
['<C-e>'] = cmp.mapping({
|
|
i = cmp.mapping.abort(),
|
|
c = cmp.mapping.close(),
|
|
}),
|
|
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
|
},
|
|
sources = cmp.config.sources({
|
|
{ name = 'nvim_lsp' },
|
|
{ name = 'snippy' },
|
|
}, {
|
|
{ name = 'path' },
|
|
}, {
|
|
{ name = 'buffer' },
|
|
}),
|
|
view = {
|
|
entries = 'native',
|
|
},
|
|
})
|
|
end
|
|
}
|
|
}
|