How to: Context-dependent word expansion in RubyMine
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.
This feature keeps you from mistyping variable names, saves you keystrokes and speeds up development. ~10 keystrokes to the price of 2!
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 wordin 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
- 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"