Products: IntelliJ IDEA, RubyMine

Vendor: Basil Gren


Provides fast Ruby code injections into erb files and ruby strings. Injector makes replacements as fast as you type shortcut text and also provides additional features. Examples:
  • '%%' --> <% | %>
  • '%=' --> <%= | %>
  • '%-' --> <%- | -%>
  • '##' --> <%# | %>
Templates can be added and/or changed in settings. See details in General Usage section.
Feel free to report bugs and your suggestions to provided e-mail.
Downloads: 4215
Participated in rating: 2
Version Compatible builds Date
1.04 139 + 25.01.2016 Download
1.02 80.8000 + 09.05.2012 Download
6 updates are hidden show all updates
Screenshot #11552

Recent change notes

Fixed options saving and updated default templates

General usage instructions

Plugin provides fast ruby code injections. After typing shortcut text, it's replaced immediately by corresponding template. Examples are listed below:

  • '%%' --> <%- | -%>

  • '%=' --> <%= | -%>

  • '%-' --> <% | %>

  • '##' --> <%# | -%>

Templates are not inserted if cursor is already in Ruby-code block. You can change existing templates of define your own templates in settings dialog which is accessible in IDE Settings or by right-click on injector icon in status bar.
Injector provides insertion of '#{}' into Ruby strings. When cursor is placed in Ruby string, shortcut (default '##') is expanded info '#{}' and if string is non-interpolating (single-quoted), it's automatically converted to interpolating (double-quoted) string. This behavior and shortcut can be changed in settings.
To enable or disable Injector you can click on injector icon in the status bar or press default shortcut Ctrl+Comma(,).


2011-12-16 16:24:13
2011-12-10 02:45:25
Finally, v1.0 is finished.
2011-10-18 00:04:20
Unfortunately, templates now are hard-coded, but customizing is the next step of development. I just need to implement settings for the plugin.
2011-10-17 17:52:06
Definitely better. Can the templates be customized, since I definitely like using the - symbols after the % (ensures that the injection line does not create a blank line in the output, good for saving some bandwidth and cleaner output).
2011-10-16 16:35:06
Dear Dmitry, thank you very much for your feedback. Actually I wrote the plugin to learn how to make plugins for IntelliJ platform and to speed up template editing with my style of coding. It was good for me because I mostly insert ruby code into ready html templates, so many bugs were unseen for me. Now having some feedback I reworked Injector to make it much more comfortable in use. From this version you can freely use '=', '#', '%' and '-' characters as usually, because now replacement is made after typing several characters instead of one. Please, try new version and I hope you will find it useful now. Please, feel free to report any bugs and suggestions here or via e-mail.
2011-10-11 19:21:43
Here are some live templates I use daily instead of this plugin... Maybe someone can instruct me how to release those maybe in some importable format on github.

ERB files only, | = cursor or $END$ varaible.

%- -> <%- | %>
%-- -> <%- | -%>
%= -> <%= | %>
end -> <%- end -%>
%=t -> <%= t("|") %>
2011-10-11 19:09:53
This plugin kind of sucks. I replaced all it’s uses with live templates, and then some. It has MANY drawbacks, allow me to elaborate:

1) Typing simple things like = and - automatically turns into tags. Which is really bad when trying to type the following: <input type="button" class="foo-bar"> as it keeps escaping. I hit this situation more times than I actually used the feature. Sure you can undo but why, when the more common use for me is %- -> <- | %> and I can go crazy like %=t -> <%= t("|") %> etc…

2) You can no longer type %, -, =, # into live templates with this plugin. That’s right I started copy-pasting from vim to get the characters into live templates. That is beyond awful.

3) The to undo is stupid. It needs to be very smart about it because a VERY common case is typing `class=` -> `class<= | %>` -> `class<= "foo %>` [OPSE, backspace, oh wait i can't undo that expansion anymore]

I’d honestly remove this plugin and add a few live templates. This plugin is more harm than good.