UltiSnips new snippet snippet
Asked Answered
C

1

12

I'm trying to create a new snippet snippet the way that the author of UltiSnips does at 1:28 in this instructional video that he made http://www.youtube.com/watch?v=f_WQxYgK0Pk

How do you put "endsnippets" inside of the snippet without it calling the end of the snippet?

So far I've put the following in ~/.vim/UtliSnips/snippets.snippets

snippet snip "The Snippet Snippet"
snippet ${1:Trigger} "${2:Description}" ${3:Options}
${0}
 endsnippet
endsnippet

This is somewhat of a solution however it creates whitespace at the start of evey "endsnippet" line for every snippet I make. I want to get it right up to the left edge of the screen just like it is in the video. Any suggestions?

Crosley answered 8/11, 2014 at 7:15 Comment(0)
C
14

The answer is actually provided in that same video from 7:50 - 8:17. So all you have to do is the following

snippet snip "The Snippet Snippet"
snippet ${1:Trigger} "${2:Description}" ${3:Options}
${0}
`echo endsnippet`
endsnippet

I actually thought about this before I posted the question, but for some reason I thought that it wouldn't work. Anyway sorry for wasting time, but hopefully this might help someone else with the same problem.

Crosley answered 9/11, 2014 at 1:24 Comment(1)
FWIW any interpolation will work, e.g. `!p snip.rv = 'endsnippet'`, or `!v 'endsnippet'` achieve the same results.Weimaraner

© 2022 - 2024 — McMap. All rights reserved.