To better use YouCompleteMe in Vim, I switched from SnipMate to UltiSnips, because UltiSnips can be integrated into YCM. I also installed snippets since UltiSnips offers an engine only.

Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'

But after I installed it with Vundle, it didn’t work correctly. It only load ‘all’ filetype snippets. You can check this by typing

:UltiSnipsEdit

in Vim. If only ‘all.snippets’ appears, then here is the problem.

Then I searched internet, finally I got answer below. The problem is caused by Vundle. Vundle installed UltiSnips has a different file directory structure, thus file type detection is disabled. To fix this, we need to build soft link to proper directories.

mkdir -p ~/.vim/after/plugin
ln -s ~/.vim/bundle/UltiSnips/after/plugin/* ~/.vim/after/plugin
mkdir ~/.vim/ftdetect
ln -s ~/.vim/bundle/UltiSnips/ftdetect/* ~/.vim/ftdetect

 

 

Reference:

https://bugs.launchpad.net/ultisnips/+bug/1067416