And Finally
And Finally

Reputation: 5704

Command-arrow for back and forward one word in PhpStorm terminal

I'm on OSX, and for some reason, when I do command - ← (back arrow) in the PhpStorm terminal I get a [D, while command - → (forward arrow) outputs a [C. What I want to do is jump forward and back one word.

enter image description here

In my OSX terminal these keypresses work as expected, and I can't find anywhere where they are set to output those characters. Does anyone have the answer to this conundrum?

Upvotes: 1

Views: 673

Answers (2)

pvledoux
pvledoux

Reputation: 981

If you are using zsh, add this to ~/.zshrc:

bindkey "\e\eOD" backward-word
bindkey "\e\eOC" forward-word

Upvotes: 2

Oleksandr Poshtaruk
Oleksandr Poshtaruk

Reputation: 2146

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

Here is the original link

Upvotes: 10

Related Questions