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?
Try this suggestion on a page from the YouCompleteMe issue tracker. In your .vimrc:
While this setting will make expanding a snippet share the default mapping for jumping forward within a snippet, it simulates TextMates' behavior as mentioned in the UltiSnips help tags.
Since I've mapped my Caps Lock key to Ctrl, this mapping works pretty smoothly.
I use
kj
. This is what is in my.vimrc
:let g:UltisnipsExpandTrigger="kj"
.It rarely happens that I run into word that has
kj
in it. If this is the case I would just wait a couple of seconds after typingk
and that typej
.Although I know this post is a little old, I have my own function that is a little more optimized than the one given above:
Of course, if you just keep the settings that Joey Liu provided and then just use this function everything will work just perfectly!
EDIT: Also, I use another function to increase back-stepping functionality between YouCompleteMe and UltiSnips. I'll show you what I mean:
Then just put this in your .vimrc:
As well as
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
and your set!I installed the UltiSnips plugin after the YouCompleteMe plugin so I thought they were conflicting, but in reality I had something more interfering:
Make sure to remove that from
.vimrc
if it's present.I use both of them together. By default YouCompleteMe binds
<Tab>
and<Down>
to select the next completion item and also<S-Tab>
and<Up>
to select the previous completion item. You can change the YouCompleteMe bindings with the g:ycm_key_list_select_completion and g:ycm_key_list_previous_completion options. Note that the names of these options were recently changed when the option was changed from a single string to a list of strings.I personally chose to not use
<tab>
with YouCompleteMe but navigate it manually.So I added this to my
.vimrc
:which simply disables the tab key for YCM. Instead you use the movement keys and select the entry with CR. UltiSnips works default with tab.