Plugin highlight: “Injector” brings single-key Ruby injections into ERB
If you use ERB for your Rails views, you should like this one.
It may not be a problem for you but I always stumble when typing <% %>
, let alone <%# %>
. Non-letter keys and you have to press Shift too. So, I was quite impressed when I saw this Injector plugin in our plugin repository recently.
It is pretty straightforward, a single character generates the whole closure and puts the caret inside.
‘%’ –> <% | %>
‘=’ –> <%= | %>
‘-‘ –> <% | -%>
‘#’ –> <%# | %>
And even though it sounds very simple, the author has put a good thought into his work. Here’s what plugin description says:
When character is just replaced (no other key presses are made), you can cancel replacement by pressing Backspace. Characters are not replaced if cursor is already in Ruby-code block. To enable or disable Injector you can click on injector icon in the status bar or press default shortcut Ctrl+Comma(,)
Kudos to Basil G. a.k.a. toXXIc!
To install the plugin open IDE Settings | Plugins, find the Injector plugin and choose Install.
Develop with pleasure!