vimautocompletepopupjedi-vim

Annoying <C-Space> does not work with YouCompleteMe (YCM)


I setup YCM on a linux system and I called vim through gui-terminal Although the YCM works fine in vim insert mode and it opens the omni menu but as soon as I press or vim enters paste mode and it does not triggers YCM.

None of the following settings in the .vimrc worked for me.

let g:ycm_key_invoke_completion = '<C-x><C-o>'
let g:ycm_key_invoke_completion = '<C-Space>'
let g:ycm_key_invoke_completion = '<Nul>'

Following diagnostic commands return

:verbose imap <Nul>
i  <Nul>       * <C-X><C-O><C-P>
        Last set from ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim

:verbose imap <C-Space>
No mapping found

:verbose imap <C-x><C-o>
i  <C-X>       * <C-R>=<SNR>20_ManualCompletionEnter()<CR>
        Last set from ~/.vim/bundle/supertab/plugin/supertab.vim

I do not know if the problem is from the SuperTab or something else, I really want the pops up the Omnimenu. Thanks


Solution

  • From :h paste

    When the 'paste' option is switched on (also when it was already on):
            - mapping in Insert mode and Command-line mode is disabled
            - abbreviations are disabled
            - 'textwidth' is set to 0
            - 'wrapmargin' is set to 0
            - 'autoindent' is reset
            - 'smartindent' is reset
            - 'softtabstop' is set to 0
            - 'revins' is reset
            - 'ruler' is reset
            - 'showmatch' is reset
            - 'formatoptions' is used like it is empty
    

    So I'm not sure why you would expect the mappings to work. Just disable paste mode if you want to edit the file normally.