I have bundles ultisnips and youcompleteme installed on my macvim.
The problem is that ultisnips doesn't work because tab is bound by ycm.
I tried putting let g:UltiSnipsExpandTrigger = "<s-tab>"
so that I can trigger the snippet completion with shift-tab, but it doesn't work for some unknown reason. I could use caps as the trigger, but so far I've found no way to do that.
Do any of you use those two add-ons together? What can I do to make shift-tab work? Can you recommend another key to trigger snippets?
Another option is using the SuperTab plugin:
Here YouCompleteMe is bound to a different combination Ctrln, but then that combination is bound to tab through SuperTab. UltiSnips and SuperTab play nice together, so you can then just bind UltiSnips to tab directly and everything will work out.
i have this in my vimrc
thats what i did on my first try, but i misspelled UltiSnips with Ultisnips.. oh well, worked out in the end!
copy the following code to your vimrc, and enjoy. This function will handle all issues between YCM and UltiSnips.
Just putting together answers by Michaelslec, Joey Liu and along with solutions I found in this issue thread and this guy's vimrc, I now have this which solved pretty much all problems.
While Many answer works fine in this post, I just want to say that the problem is caused by key binding collision between YCM and UltiSnip, while YCM support UltiSnip snippets by default, it takes the default UltiSnip expand trigger
<tab>
as its completion select key, so UltiSnip snippets will not be expaned by<tab>
. Give them different key binding will solve the problem, I personally use<c-n
and<c-p>
for YCM and use the default<tab>
for UltiSnip. You can get more details withhelp youcompleteme
doc in vim.Based on Siegfried's answer, I am using the following which seems more natural:
I also use the
c-hjkl
bindings somewhere else (switching from a pane to another), but that would only be in normal mode, so there's no problem.