Snippets with duplicate variables to repeat text


I would like to create a snippet that uses the same variable twice:

context "some context" do
end # some context

So I tried creating a snippet:

context "$1" do
end # $1

But it did not do what I wanted. Is there an easy way to do what I want?


What did it do? That might help diagnose your issue.


Pretty easy to reproduce :smile:

It jumped to the $1 at the end and did not fill in the initial $1 when I filled it in. That’s as far as I bothered, since it clearly was not doing what I’d hoped.