Skip to content

Instantly share code, notes, and snippets.

@emanueljacob
Last active August 27, 2019 13:17
Show Gist options
  • Save emanueljacob/e341835ef266e67b63a2620aee692fdd to your computer and use it in GitHub Desktop.
Save emanueljacob/e341835ef266e67b63a2620aee692fdd to your computer and use it in GitHub Desktop.
Alt + Arrow Key Bindings for JetBrains IntelliJ/PhpStorm on MacOS
# Currently the embedded terminal of Jetbrains IDEs does not make use of keybindings defined in terminal/iterm on mac
# Instead yo get the ring bell and output like [C or [D
#
# see: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000013224-Alt-key-not-working-in-embedded-terminal
#
# to fix it and allow ALT + Arrow in the the IDEs embedded terminal just do the following (depending on wich shell you use)
# If you use zsh
# Add this to ~/.zshrc :
bindkey "\e\eOD" backward-word
bindkey "\e\eOC" forward-word
# If you use bash
# Add this to ~/.inputrc
"\e\e[C": forward-word
"\e\e[D": backward-word
# -> don't forget to restart the terminal/IDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment