0

I am trying to use UltiSnips and neosnippet plugins simultaneously because of some features that the one has and the other doesn'nt and vice versa. So Mapped Ultisnips and neosnippet like the following :

"UltiSnips
let g:UltiSnipsExpandTrigger="<Tab>"
let g:UltiSnipsJumpForwardTrigger="<Tab>"
let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"`

and

"neosnippet
imap <C-b> <Plug>(neosnippet_expand_or_jump)
smap <C-b> <Plug>(neosnippet_expand_or_jump)
xmap <C-b> <Plug>(neosnippet_expand_target)

everything works fine, until i decide to make a superTab that do the jumping in both plugins select mode with hitting Tab key. jumping in UltiSnip is done with Tab key by means of the following map that sets by plugin itself:

exec "snoremap <silent> " . g:UltiSnipsExpandTrigger . " <Esc>:call UltiSnips#ExpandSnippetOrJump()<cr>"

so i can jump with Tab key in select mode seamlessley. For the neosnippet to jump in select mode with tab key i change the smap like this :

smap <Tab> <Plug>(neosnippet_expand_or_jump)

but this does not work and its natural because UltiSnips maps its keys after neosnippet plugin; so i change the mapping to:

au InsertEnter * exec "smap " . g:UltiSnipsExpandTrigger . " <Plug>(neosnippet_expand_or_jump)"

But now i can jump in neosnippet expanded snippets with tab key in select mode and cant jump in UltiSnips snippets. so my question is how can accomplish this?

i tried :

au InsertEnter * exec "smap " . g:UltiSnipsExpandTrigger . " neosnippet#expandable_or_jumpable() ? '\<Plug>(neosnippet_expand_or_jump)' : '\<Esc>:call "UltiSnips#ExpandSnippetOrJump()<cr>'"

and

au InsertEnter * exec "smap " . g:UltiSnipsExpandTrigger . " exists(g:ulti_expand_or_jump_res) ? '\<Esc>:call "UltiSnips#ExpandSnippetOrJump()<cr>' : '\<Plug>(neosnippet_expand_or_jump)'"

but they does not work :(

dNitro
  • 5,145
  • 2
  • 20
  • 45
  • What are the features that one has and the other one doesn't? – VanLaser Aug 15 '15 at 23:39
  • Though UltiSnips is so complete, its placeholder selection doesn't work well in many complex situations like nested snippets and times when you select candidates from popup menu list items or any other situations you may encounter; In such situations it nearly reside in wrong positions in select mode. But because of marker based snippet engine of neosnippet plugin, placeholder selection always done right. It's a feature that's remarkably important. contrarily UltiSnips Interpolations are so powerfull and neosnippet is not able to do them at same degree of power and rigidity! – dNitro Aug 18 '15 at 19:56
  • So in my opinion Ultimate power to using snippets is by using this two plugins simultaneously! at least up to that time that UltiSnips overcome [this issue](https://github.com/SirVer/ultisnips/issues/528) or a new vim (neovim) come up! – dNitro Aug 18 '15 at 19:57

0 Answers0