Split plugins into files by category
This commit is contained in:
49
.config/nvim/lua/plugins/cmp.lua
Normal file
49
.config/nvim/lua/plugins/cmp.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user