One very common feature of textmate that I miss is to add erb tags, and cycle them:
<%= %> using ctrl (shift) ‘>’
Is there any equivalent in sublime?
One very common feature of textmate that I miss is to add erb tags, and cycle them:
<%= %> using ctrl (shift) ‘>’
Is there any equivalent in sublime?
I actually add this snippet to every editor I use. I use the NetBeans standard of “re+TAB” for <%= %> and "r+TAB for <% %>… just cause NetBeans is the editor I was using when I started doing Ruby. Get Ryan Bates’ “Ryan on Rails” bundle for some really helpful ERB stuff.
Creating snippets yourself is super easy. Take a look in your package directory for some great examples.
Adding the following into the User sublime-keymap file adds the function to insert <%= 5> but it doesn’t toggle between <% %> unfortunately . Anybody have any ideas?
[code] { “keys”: “ctrl+shift+.”], “command”: “insert_snippet”, “args”: {“contents”: “<%= ${0:$TM_SELECTED_TEXT} %>”}, “context”:
{ "key": "selector", "operator": "equal", "operand": "text.html, source.yaml, meta.erb" }
]
}[/code]
I’ve created a plugin that inserts and cycles the ERB tags. You can download it here: