Shortcut to insert closing bracket for HTML tag with attributes?

Hi, all -

I'm demo'ing Rubymine and really like it so far. However, one small thing is driving me a bit nuts...

When I am working on a .html.erb file and I create a tag, I have it set so writing an attribute and the equals sign automatically creates a pair of quotes. This is fine, I then type the value of the attribute...

However, now my cursor is behind the closing quote and I have to hit the end or right arrow key to get to the end of the line to type a ">" or "/>" to close the tag declaration.

I noticed that CTRL+SHIFT+ENTER will automatically enter "/>" at the end of the line (I wish it put a space before the slash, but I can live with that). However, I've been unable to find a similar shortcut to insert the ">"

So when I start my tag and I am sitting with"

<div id="foobar"

Is there anything I can hit to close that open div declaration?

Thanks in advance.


PS - it's very possible that there is info out there om this already....I searched the docs and forums, but could not come up with anything. My apologies if there is an obvious answer to this.

2 comments
Comment actions Permalink

Hi there,

(I wish it put a space before the slash, but I can live with that).

You can -- just edit your code style accordingly (Settings | Code Style | HTML | Other --> Spaces | In empty tag)

Is there anything I can hit to close that open div declaration?

Yes.

  1. Type your example code in valid HTML file
  2. Place cursor somewhere in the middle of that line
  3. "Edit | Macros | Start Macro Recording"
  4. Do the job as you would usually do: [END]>  (press "end" key and type ">" )
  5. Stop Macro Recording and give it a name
  6. "Setting | Keymap | Macros" -- find than macros and assign any shortcut you want
  7. Start using it
0
Comment actions Permalink

Hey - thank you for your reply! Going to give it a shot now, thanks for taking the time to write out the steps to record the macro. Much appreciated!

0

Please sign in to leave a comment.