Top 10 RubyMine key shortcuts

Key shortcuts are something which I always like to learn. They can greatly improve your effectiveness. So today I wanted to share with you my top 10 shortcuts for RubyMine on a macOS. I guess they'll work in all JetBrains products.

Top 10 RubyMine key shortcuts

I always like to look for a way to expand my skills as a developer. One of the areas where you can always improve your efficiency is "know your tools".

I sometimes google for Top 10 something. For example:

  • Top 10 RubyMine plugins
  • Top 10 tools for K8s management
  • Top 10 Rails gems
  • etc.

This often helps me to learn about what's new in the wild but also satiates my inner boy/child necessity for playing with some new toys :D.

Key shortcuts are something which I always like to learn. They can greatly improve your effectiveness. So today I wanted to share with you my top 10 shortcuts for RubyMine on a macOS. I guess they'll work in all JetBrains products.

Show Actions

⌘ + ⇧ + A

This will show you a prompt where you can run any IDE action. Be it git, selecting text, refactoring, preferences etc.

Select occurrences

+ ⇧+ G

Select all occurrences. Without shift, it will select next occurrence

Duplicate line

⌘ + d

Duplicates currently active line. You can also use it for larger chunks by selecting e.g. a code block.

Open Class

+ O

Find/open class

Multiline mode

+ ⇧ + 8

Enter multiline mode

There are a few ways you can use it

  • you can select multiple lines and then press the shortcut
  • you can run shortcut and then press shift and hit down arrow to multiply carets

Commit changes to git

This is actually a whole  sequence

  • + k - open commit window
  • ⌃ + ⌥ + i - commit
  • + ⇧ + k - push

Go to declaration / Show usage

+ b

Depending on where you are it goes to either declaration, or shows usage

Recent files

+ e

Show recently opened files
Second press shows recently edited files

Refactor this

⌃+ t

It opens the refactoring menu.  Useful if you are currently doing Anti-If course from Arkency ;)

Run / Debug

⌃ + ⇧ + r / ⌃ + ⇧ + d

Run / debug this test or file depending on the context.
Without shift, it runs the file/test that was run as the last.

You can see that on the first run it runs the whole spec file. The second time it runs only the RSpec context because the caret was within it 

Show content

⌥ + space

Shows content of the class or method in a popup window

Key Promoter X

There is actually a very nice plugin for JetBrains tools that will help you to learn shortcuts for all the shortcuts you are doing with your mouse, and it will suggest it to you if it learns that you are doing this particular action many times.


Photo by Athul Cyriac Ajay on Unsplash