1

I'm trying SpaceVim and I would like to use the plugin UltiSnips with it, instead of Neosnippets that comes with it as default. Based on what I found in http://spacevim.org/documentation, https://spacevim.org/layers and in :h SpaceVim I did what follows. I added this to .SpaceVim.d/init.vim:

let g:spacevim_force_global_config = 0
let g:spacevim_snippet_engine = 'ultisnips'
" disable neosnippet to avoid conflict with UltiSnips
let g:spacevim_disabled_plugins=[
\ ['Shougo/neosnippet.vim'],
\ ]
" custom plugin
let g:spacevim_custom_plugins=[
\ ['SirVer/ultisnips/', {'on_ft' : 'autocomplete'}],
\ ]
let g:neosnippet#snippets_directory = '~/.SpaceVim.d/snippets'

I created manually a directory 'snippets' inside .SpaceVim.d and put a directory UltiSnips with my snippet file 'tidal.snippets', for Tidal. My snippets are like so:

snippet spr$ "spread ($)" i
spread ($) [ $1, $2, $3 $0]
  ${VISUAL}
endsnippet

My setup is Linux Ubuntu 17.10, Neovim, SpaceVim 0.6-dev

I'm getting this errors when I try to expand a snippet:

Error detected while processing function SpaceVim#mapping#tab#expandable:                                                                             
line    1:                                                                                                                                            
E117: Unknown function: UltiSnips#ExpandSnippetOrJump                                                                                                 
Press ENTER or type command to continue                                                                                                               
Error detected while processing function SpaceVim#mapping#tab#expandable:                                                                             
line    1:                                                                                                                                            
E15: Invalid expression: UltiSnips#ExpandSnippetOrJump()                                                                                              
Press ENTER or type command to continue                                                                                                               
Error detected while processing function SpaceVim#mapping#tab#expandable:                                                                             
line    2:                                                                                                                                            
E121: Undefined variable: g:ulti_expand_or_jump_res                                                                                                   
Press ENTER or type command to continue                                                                                                               
Error detected while processing function SpaceVim#mapping#tab#expandable:                                                                             
line    2:                                                                                                                 
E15: Invalid expression: g:ulti_expand_or_jump_res > 0                                                                                                
Press ENTER or type command to continue

What I'm doing wrong? How could I make this work?

1

Just remove

let g:spacevim_custom_plugins=[
\ ['SirVer/ultisnips/', {'on_ft' : 'autocomplete'}],
\ ]

no need to use custom plugin, just change g:spacevim_snippet_engine is enough.

If you still get issue, please use the issue tracker of SpaceVim github repo.

  • The errors stopped but it seams like the UltiSnip snippets file is not being found. Where should I put it? – skmecs Dec 17 '17 at 15:43
  • I tried by adding this: ` let g:UltiSnipsSnippetDirectories=$HOME.'/.SpaceVim.d/UltiSnips' ` but it made no effect – skmecs Dec 17 '17 at 16:17
  • oh, it is overrided in spacevim, I will fix it, the default value is ~/.SpaceVim.d/UltiSnips – Wang Shidong Dec 20 '17 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.