Read more

How to: Context-dependent word expansion in RubyMine

Dominik Schöler
November 25, 2014Software engineer at makandra GmbH

One of the many useful features of TextMate is autocompletion of words. If I were in TextMate right now, I could write "au[tab]", and it would complete it to "autocompletion". RubyMine can do this, too. When you write a word (e.g. a variable name), just hit ALT + / repeatedly and it will offer all completions for the letters you typed. This action is called Cyclic Expand Word in RubyMine / IntelliJ IDEA.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

This feature keeps you from mistyping variable names, saves you keystrokes and speeds up development. ~10 keystrokes to the price of 2!

German keyboards

You can't type ALT+/ on a German keyboard. I recommend setting the shortcut to Ctrl+. (period), which is the same that Eclipse uses for word completion.

To change the key mapping:

  • Go to File / Settings
  • Search for cyclic expand word in the settings dialog
  • In the right pane an entry Main menu / Code / Completion / Cyclic Expand Word should be highlighted
  • Right-click on that entry and select Add keyboard shortcut
  • In the new dialog, hold Ctrl and press .
  • Press OK
  • RubyMine will now warn you that this shortcut is already taken by a functionality you don't care about. Select Remove to confirm the new assignment.
  • Close the settings dialog with "OK"
Posted by Dominik Schöler to makandra dev (2014-11-25 13:06)