Open benbrastmckie opened 1 year ago
I'm having the same problem. I've tried several mapping configs but couldn't make it work
Had the same issue.
Looking at thecmp.mapping.preset.cmdline
implementation (https://github.com/exosyphon/nvim/blob/2800baf59612b3a2498f9e764229fe05f6b1276a/after/plugin/lsp.lua#L63)
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline({
['<C-k>'] = {
c = function()
local cmp = require('cmp')
if cmp.visible() then
cmp.select_prev_item()
else
cmp.complete()
end
end,
},
['<C-j>'] = {
c = function()
local cmp = require('cmp')
if cmp.visible() then
cmp.select_next_item()
else
cmp.complete()
end
end,
},
}),
sources = {
{ name = 'buffer' }
}
})
Did the trick for me (note cmp.select_next_item()
vs cmp.mapping.select_next.item()
I am attempting to get
<C-j>
and<C-k>
to be the means by which I navigate menu options throughout nvim. CurrentlyTab
and<S-Tab>
work when selecting from options in the command line or search. I have tried the following but without success:I tried checking the mapping with
:verbose cmap <C-j>
and similarly for<C-k>
and found that no mapping was found before or after including the config given above. Any help would be much appreciated!