Commit 9f95518a authored by Jan Hensel's avatar Jan Hensel 🐧
Browse files

nvim::cmp: fix bindings (likely slightly broken)

- my cmp bindings stopped working for some reason, it used to just
  work with ctrl-n/p but now that aborts the completion
- might be the 0.7 upgrade I did recently
- on 0.8-dev this works for me
parent 9d09cff0
......@@ -10,10 +10,29 @@ cmp.setup{
end,
},
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c'}),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
["<C-n>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end,
["<C-p>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end,
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment