roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
917 stars 49 forks source link

How to remap <C-n> and <C-p>? #177

Closed ijsnow closed 6 years ago

ijsnow commented 6 years ago

Heyo! Great plugin. Thanks a lot!

I was just wondering how I could remap the navigating keys to something closer together like and or something like that.

Could you point me in the right direction?

Shougo commented 6 years ago

Example:

inoremap <Tab> pumvisible()? "\<C-n>" : "\<Tab>" inoremap <S-tab> pumvisible()? "\<C-p>" : "\<S-Tab>"

ijsnow commented 6 years ago

Thanks, but that didn't work! I saw that in the README for mapping to tab but I couldn't translate it to other keys. I tried this so that ctl-n is reverse and ctl-m is forward to no avail:

inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<C-m"
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<C-n"
Shougo commented 6 years ago
inoremap <expr> <C-m> pumvisible() ? "\<C-n>" : "\<C-m>"
inoremap <expr> <C-n> pumvisible() ? "\<C-p>" : "\<C-n>"
ijsnow commented 6 years ago

None of this worked for me but I got used to \/\