Created
March 15, 2020 11:41
-
-
Save wcomnisky/c7c5413cc5d124eab051db7cc1e5b510 to your computer and use it in GitHub Desktop.
Terminal shortcuts for Mac terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: https://coderwall.com/p/a8uxma/zsh-iterm2-osx-shortcuts | |
We all love OSX built-in shortcuts | |
⌥ + ← or → - move one word backward/forward | |
⌘ + ← or → - move to beginning/end of line | |
In zsh you can use ctrl + a/e to move to beginning/end of line and esc + W/B to move one word backward/forward, but that's not very handy. | |
Here is a solution to map ⌥ + ← / → and ⌘ + ← / → to work in iTerm2 as expected | |
Put this in your .zshrc | |
bindkey "[D" backward-word | |
bindkey "[C" forward-word | |
bindkey "^[a" beginning-of-line | |
bindkey "^[e" end-of-line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment