我在Linux系统上设置了YCM,我通过gui-terminal调用了vim 虽然YCM在vim插入模式下工作正常,但它打开了全向菜单 但是当我按下或vim进入粘贴模式并且它不会触发YCM时。
.vimrc中的以下任何设置都不适合我。
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>'
以下诊断命令返回
: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
我不知道问题是来自SuperTab还是别的什么,我真的想要弹出Omnimenu。 感谢
答案 0 :(得分:1)
来自: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
所以我不确定为什么你会期望映射能够工作。如果要正常编辑文件,请禁用粘贴模式。