8

sometimes I need to use a variable multiple times in a snippet. For instance, when I need to set a key-value list:

${1}_key: ${1}_value

I hope the cursor can stop at the first ${1} when I trigger snipmate in this case. When I input something like foo at the first ${1}, it can become

foo_key: foo_value

Thus, I need to input foo only once. How can I achieve this?

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
Brian
  • 30,156
  • 15
  • 86
  • 87

1 Answers1

13

It's easy:

${1:}_key: $1_value
Brian
  • 30,156
  • 15
  • 86
  • 87