Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable YouCompleteMe and enable NeoComplete, only for one filetype?

I use YouCompleteMe for auto-completion in Vim. It doesn’t work well together with VimShell, so I want to disable it, only within VimShell buffers.

How can I disable YouCompleteMe and enable NeoComplete from Vimscript?

like image 581
Alaya Avatar asked Apr 02 '15 03:04

Alaya


1 Answers

YouCompleteMe allows you to configure a filetype whitelist and blacklist that enables or disables completion for given filetypes.

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

Neocomplete has a similar feature, with NeoCompleteUnlock/NeoCompleteLock.

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

For example, to disable YouCompleteMe and enable NeoComplete for the vimshell filetype, you could use something like this in your .vimrc:

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

I cannot test this, as I do not use vimshell.

like image 109
mikewaters Avatar answered Oct 13 '22 02:10

mikewaters