1
Fork 0
satellite/dotfiles/neovim/lua/my/plugins/cmp.lua
2022-02-09 22:20:34 +02:00

26 lines
970 B
Lua

local M = {}
function M.setup()
local cmp = require("cmp")
cmp.setup({
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'}),
['<C-y>'] = cmp.config.disable,
['<C-e>'] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}),
['<CR>'] = cmp.mapping.confirm({select = true})
},
sources = cmp.config.sources({}, {{name = 'buffer'}})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})})
end
return M