2

I have tried many of the available online instructions on remapping my <Tab> key in my vimrc file but none of them have any effect. If I run :map! <Tab> ᐅ directly from command entry it'll work, but not from vimrc.

When I run :verbose imap <Tab> I get the following.

i  <Tab>       * pumvisible() ? "\<C-N>" : "\<Tab>"
    Last set from ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim

Looking at the source code for YouCompleteMe I see a variable of key is present which is mapped to <Tab> if it's not in completion mode. How can I set what the <Tab> key is when not in completion mode for YouCompleteMe?

1
  • You can override the plugin mapping in a file in ~/.vim/after/plugin/mystuff.vim
    – B.G.
    Commented Mar 27, 2017 at 7:17

1 Answer 1

2

Credit to: https://github.com/micbouanswer

If what you want is inserting the ᐅ symbol when the completion menu is not visible, adding these lines to your vimrc should do the trick:

" Remove <Tab> from the list of keys mapped by YCM.
let g:ycm_key_list_select_completion = ['<Down>']
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "ᐅ"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.