Correct syntax for tabstop at VISUAL placeholder

Asked by Marshall Eubanks

Surely this is possible....

The VISUAL placeholder does exactly what I want it to do, except it doesn't actually work as a tab stop.

How can I express a VISUAL placeholder which is also a tabstop?

Question information

Language:
English Edit question
Status:
Answered
For:
UltiSnips Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
SirVer (sirver) said :
#1

${1:${VISUAL}}

Revision history for this message
Marshall Eubanks (marshaul) said :
#2

Oh, duh, the one permutation I didn't try.

Thanks so much for your help.

This is gonna be great. =D

Revision history for this message
SirVer (sirver) said :
#3

It makes sense: ${1:default text} and you want the default to be the visual text. Btw, this is also in one of the examples in the doc which I urge you to read.

Revision history for this message
Marshall Eubanks (marshaul) said :
#4

Yup, it makes sense when you put it that way. You can see an example of what I was trying in my other question.

For the record, it may be that a manual seems more, shall we say, accessible when one has written it than when one is merely reading it.

For instance:

The following snippet uses the regular expression option and illustrates
regular expression grouping using python's match object. It shows that the
expansion of a snippet can depend on the tab trigger used to define the
snippet, and that tab trigger itself can vary.

------------------- SNIP -------------------
snippet "be(gin)?( (\S+))?" "begin{} / end{}" br
\begin{${1:`!p
snip.rv = match.group(3) if match.group(2) is not None else "something"`}}
    ${2:${VISUAL}}
\end{$1}$0
endsnippet
------------------- SNAP -------------------

Nowhere does it say anything about the fact that that example *also* demonstrates the use of the VISUAL placeholder as a tabstop.

Sure, now that you've *told* me the syntax, I see it. But, not only did I read the manual, I read that very example. I was too busy following how it achieves what you explicitly pointed out to notice that detail, apparently.

Revision history for this message
SirVer (sirver) said :
#5

Point taken and iI agree that the manual covers a lot of ground. The particular syntax is also discussed and explained in the third Episode of my screencasts around the 4 minute mark.

http://www.youtube.com/watch?v=hKrrOevbrxY

I wish I could make it easier to grasp, but I feel that I did what I could.

Revision history for this message
Marshall Eubanks (marshaul) said :
#6

Don't get me wrong, I think you've done a fantastic job. UltiSnips is feature-rich and well-documented.

It kind of comes with the territory, I guess. It's hard to have something which can do so much, and explain or understand it perfectly the first time.

Can you help with this problem?

Provide an answer of your own, or ask Marshall Eubanks for more information if necessary.

To post a message you must log in.