default mappings for cmdline <C-n> and <C-p> can be obstrusive
I added the mapping shown in the README below:
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
I ran into a problem when hitting <C-p> to select previous commands. As soon as I run into a command that triggers cmp to open the menu, preset.cmdline <C-p> mapping takes effect, and prevents me from scrolling onto previous commands. Instead, I scroll the different available completion items.
I don't know if this is an actionable issue, or what a solution to it might look like, but I found the default behavior to be somewhat unintuitive, so I thought I'd report it here.
This works for me
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline {
['<C-n>'] = cmp.config.disable,
['<C-p>'] = cmp.config.disable,
},
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
Right, I'm wondering if something like that should be the default?
You can also always abort the current completion using <C-e> and then <C-n/p> should do command history completion again.
Since neovim's wildmenu by default also uses <C-n> and <C-p> for navigating the completion (when wildmenu is currently active), I think nvim-cmp's defaults are fine and this issue can be closed.