Skip to content

Instantly share code, notes, and snippets.

@gofer
Last active November 17, 2015 10:33
Show Gist options
  • Save gofer/7ce6e937fc6fb614bf5a to your computer and use it in GitHub Desktop.
Save gofer/7ce6e937fc6fb614bf5a to your computer and use it in GitHub Desktop.
key binds for zsh
### Bind key ###
# Linux
if [ `uname -a | grep 'Linux' | wc -c` -ne 0 ]; then
if [ -n "${TMUX}" ]; then
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
else
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
fi
bindkey "^[[3~" delete-char
bindkey "^[[2~" overwrite-mode
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
fi
# tmux on cygwin
if [ `uname -a | grep 'Cygwin' | wc -c` -ne 0 ]; then
if [ -n "${TMUX}" ]; then
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
else
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
fi
bindkey "^[[3~" delete-char
bindkey "^[[2~" overwrite-mode
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment