Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move forward and backward by one word in embedded local terminal

Does anyone know what is the keyboard key to jump between word to word in embedded local terminal for WebStorm or PyCharm?

I have use Option (Alt) key + Arrow Left/Right to jump between word in Mac or mac terminal, but when I turn on embedded local terminal in WebStorm it just show [D or [C.

Searching lots online, cannot find a better solution but only find that may be the issue for WebStorm/PyCharm about meta key and Esc.

like image 560
jacobcan118 Avatar asked Jul 12 '17 12:07

jacobcan118


People also ask

How do you jump between words in Mac terminal?

Hold option ( alt on some keyboards) and press the arrow keys left or right to move by word. Simple as that. Also ctrl e will take you to the end of the line and ctrl a will take you to the start.

How to move fast in iTerm?

To Get Forward (Alt-f), Backward (Alt-b) and Delete (Alt-d) Word. Open iTerm. Under Profile Shortcut Keys, click the + sign. Type your key shortcut (option-b, option-f, option-d, option-left, etc.)


1 Answers

I'm glad you brought this up because I've been wanting to fix the problem for a long time now but kept forgetting! The solution I came up with is manually adding the key binding directly to the .bash_profile. Here's a walk through:

Open .bash_profile using nano or whatever (editor you want to use) by running: nano ~/.bash_profile

Then paste where ever you want in the .bash_profile these commands: bind '"\e\e[C": forward-word' bind '"\e\e[D": backward-word'

Press ^x (that is the control key and the x key) > y > enter to save the .bash_profile changes.

Once that's finished, restart the terminal in WebStorm/PyCharm and enjoy!

like image 71
Evan Wieland Avatar answered Nov 13 '22 15:11

Evan Wieland