hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
550 stars 42 forks source link

Unable to confirm selection with nvim's default mappings #36

Closed grezp closed 2 years ago

grezp commented 2 years ago

All other default mappings work as expected. For example, <C-n> for next, <C-p> for previous, <C-e> to close.

However, <C-y> to confirm does not work on either command mode or while searching. It places a ^Y char.

Creating a mapping config does not work:

mapping = {
  ['<C-y>'] = cmp.mapping.confirm({ select = true }),
}

How can I enable this?

gegoune commented 2 years ago

It works for me, I do set it up in main cmp.setup({}), like that:

cmp.setup({
  mapping = {
      ['<C-y>'] = cmp.mapping(cmp.mapping.confirm { select = true }, { 'i', 'c' }),
  }
})