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

9.3k Views Asked by At

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?

1

There are 1 best solutions below

0
mikewaters On

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.