Skip to content

Instantly share code, notes, and snippets.

@evandhoffman
Last active January 15, 2018 23:48
Show Gist options
  • Save evandhoffman/be5fb045bf998283ecdad56eb89c23ec to your computer and use it in GitHub Desktop.
Save evandhoffman/be5fb045bf998283ecdad56eb89c23ec to your computer and use it in GitHub Desktop.
How to make home & end keys work on zsh (Linux)
# From here: https://bbs.archlinux.org/viewtopic.php?pid=201942#p201942
# key bindings
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey "\e[5~" beginning-of-history
bindkey "\e[6~" end-of-history
bindkey "\e[3~" delete-char
bindkey "\e[2~" quoted-insert
bindkey "\e[5C" forward-word
bindkey "\eOc" emacs-forward-word
bindkey "\e[5D" backward-word
bindkey "\eOd" emacs-backward-word
bindkey "\ee[C" forward-word
bindkey "\ee[D" backward-word
bindkey "^H" backward-delete-word
# for rxvt
bindkey "\e[8~" end-of-line
bindkey "\e[7~" beginning-of-line
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
# for freebsd console
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
# completion in the middle of a line
bindkey '^i' expand-or-complete-prefix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment