Sep 23

Make word-back and word-forwards navigation work again on PhpStorm's Terminal

Fri, 09/23/2016 - 22:12 — peter

The Problem

JetBrains' IDEs are awesome! The more you get into them, the more you rely on them. One problem, however, has pestered me for a while: the built-in terminal doesn't have support for the word-back and work-forwards shortcut. You know, when you hold alt + left-arrow or alt + right-arrow? Most of the time I use a Mac, so in the past I used a pretty nifty program called "Keyboard Maestro" to create a shortcut that worked only on PhpStorm and other JetBrains IDEs that would do that for me, but as well as that worked, I always wondered if there was a nicer way. Turns out there is!

The Solution

Turns out that an answer for the same problem on iTerm also works for PhpStorm! The fix involves creating a new file named ~/.inputrc and then put the following code in it:

"\e\e[D": backward-word
"\e\e[C": forward-word

Easy Peasy!