add <% -%> code completion

Hello,

Perhaps I have missed something, but i cannot find a way of adding an automatice -%> code completion to a <% tag. Would be grateful for any answers!

Kind regards

4 comments
Comment actions Permalink

Using autocompletion feature
1. Type '<'
2. Invoke autocompletion popup (ctrl+space)
3. Choose '<%', press whitespace or enter and '%> will be inserted automatically

Using action - RubyMine | Tools | Extensions | Erb | Insert '<%= %>

0
Comment actions Permalink

Thanks Roman - I was expecting an autocompletion like { }, ' ', " ", ( ) or [ ], that is the completion appearing immediately after typing the first part. I believe the correct code completion is "-%>", not "%>" i.e. the minus sign is missing. If I am correct here, is there someway of changing this?

Kind regards

0
Comment actions Permalink

Hi Paul.

I believe that both %> and -%> are valid, the later option trims any trailing spaces, AFAIK.

As for setup, I've setup r for <% -%> and re for <%= -%> using File -> Settings -> Live Templates -> under HTML/XML.

r:

Abbreivation e
Template test: <% $END$ -%>
Expand with: Default (Tab)
Content: RHTML (checked).

re is setup in a similar fashion.

I believe there a key shortcut (shift + cntrl + . - at least on my Lenny setup) that produces <%= %>.

HTH

0
Comment actions Permalink

Perfect! Thanks very much!

0

Please sign in to leave a comment.