Youcompleteme: Remap Tab key when not in completion mode.

Created on 26 Mar 2017  ·  2Comments  ·  Source: ycm-core/YouCompleteMe

Issue Prelude

  • [x] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [x] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [x] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.

Issue Details

I have tried most 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 I see a variable of key is present which maps it 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?*

Most helpful comment

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:

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

All 2 comments

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:

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

Thank you! That works!

Was this page helpful?
0 / 5 - 0 ratings