如何禁用YouCompleteMe并启用NeoComplete,仅针对一种文件类型?

时间:2015-04-02 03:36:29

标签: vim neocomplete

我在Vim中使用YouCompleteMe进行自动完成。它与VimShell一起使用效果不佳,所以我想在VimShell缓冲区内禁用它。

如何禁用YouCompleteMe并从Vimscript启用NeoComplete

1 个答案:

答案 0 :(得分:10)

YouCompleteMe允许您配置文件类型白名单和黑名单,以启用或禁用给定文件类型的完成。

https://github.com/Valloric/YouCompleteMe#the-gycm_filetype_whitelist-option

Neocomplete具有类似功能,NeoCompleteUnlock / NeoCompleteLock

https://github.com/Shougo/neocomplete.vim/blob/290b9532ae3a04b53f0d0ecdee34e2b664229939/doc/neocomplete.txt#L204

例如,要禁用YouCompleteMe并为vimshell文件类型启用NeoComplete,您可以在.vimrc中使用类似的内容:

let g:ycm_filetype_blacklist = { 'vimshell': 1 }
autocmd FileType vimshell NeoCompleteUnlock

我无法测试,因为我不使用vimshell。

相关问题