I’m writing a few snippets to use in Ruby on Rails Erb views. For example:
[code]
<![CDATA[<% if $1 %>
<% else %>
<% end %>
]]>
-if
text.html.ruby
<% if %><% else %><% end %>
[/code]
Here I want to be able to fill out the if condition, then hit tab and have the cursor move inside the if block. Ideally, I’d like be able to trigger another snippet here, but the current snippet is still active so I can’t. Failing that, I’d like to just leave the cursor inside the if block and end the snippet block.
What I want to do:
-if
(fill out the if statement)
(inside the if block. this snippet is over; now I can trigger other snippets)
What currently happens:
-if
(fill out the if statement)
(jump to after the end tag. move the cursor back up to the if block manually.)
I guess I can just make three snippets. This seemed more convenient.