Skip to content

Instantly share code, notes, and snippets.

@CaffeinatedBeing
Last active April 14, 2025 09:02
Show Gist options
  • Save CaffeinatedBeing/406bf322143867dc87918e9a8e95afe4 to your computer and use it in GitHub Desktop.
Save CaffeinatedBeing/406bf322143867dc87918e9a8e95afe4 to your computer and use it in GitHub Desktop.
# <<<<< Enable natural text editing on terminal (this works for iTerm and all other mac OSX terminals)
#
# Move to the beginning of the line. `Cmd + Left Arrow`:
bindkey "^[[1;9D" beginning-of-line
# Move to the end of the line. `Cmd + Right Arrow`:
bindkey "^[[1;9C" end-of-line
# Move to the beginning of the previous word. `Option + Left Arrow`:
bindkey "^[[1;3D" backward-word
# Move to the beginning of the next word. `Option + Right Arrow`:
bindkey "^[[1;3C" forward-word
# Delete the word behind the cursor. `Option + Delete`:
bindkey "^[[3;10~" backward-kill-word
# Delete the word after the cursor. `Option + fn + Delete`:
bindkey "^[[3;3~" kill-word
#
# Enable natural text editing >>>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment