Search code examples
ruby-on-railsrubyminekeymapping

Create a new keymap in RubyMine


I use the default keymap Ctrl+Shift+Period to insert <%= %> quite often. Such a small shortcut sped up the way I edit my views. Now I want to add a new keymap that allows me to add <% %> when say Ctrl+Shift+Comma is pressed.

I checked out the JetBrains "Configuring Keyboard Shortcuts" DOC and could only find a way how to edit the default keymaps.

Does anyone have a method for creating a new keymap?

Note: I'm currently running RubyMine 6.3.3


Solution

  • I use the default keymap Ctrl+Shift+Period

    You are using wrong terms.

    What you called a "keymap" is actually a "shortcut" (keyboard or mouse one).

    Keymap in terms of IDE is a collection of shortcuts that associated with specific actions.


    You cannot create brand new and empty keymap -- there is no real reason/benefit doing that for ordinary user (although it makes sense when creating keymap of another product) as all actions will have no shortcuts at all.

    Your only option is to make a copy of any (most suitable for you) bundled keymap and then alter it as you wish. This way you will have all shortcuts from original keymap (unless overridden) plus your changes on a top. Therefore the link you have found is valid.

    This way, if devs will add new action with some shortcut in next version, it will also be available in your keymap as your one inherits the original one.