2012-06-15 16:54:02 +02:00
|
|
|
## Zsh Key bindings
|
|
|
|
|
2012-08-13 18:18:56 +02:00
|
|
|
## References:
|
|
|
|
## http://mundy.yazzy.org/unix/zsh.php
|
|
|
|
## http://www.zsh.org/mla/users/2000/msg00727.html
|
2012-06-15 16:54:02 +02:00
|
|
|
|
|
|
|
## Bindings functions:
|
|
|
|
# backward-char
|
|
|
|
# backward-delete-char
|
|
|
|
# backward-delete-to-slash
|
|
|
|
# backward-word
|
|
|
|
# beginning-of-history # PageUp
|
|
|
|
# beginning-of-line # Home
|
|
|
|
# delete-char # Del
|
|
|
|
# down-line-or-history
|
|
|
|
# down-line-or-search
|
|
|
|
# emacs-backward-word
|
|
|
|
# emacs-forward-word
|
|
|
|
# end-of-history # PageDown
|
|
|
|
# end-of-line # End
|
|
|
|
# forward-char
|
|
|
|
# forward-word
|
|
|
|
# quoted-insert # Ins
|
|
|
|
# up-line-or-history
|
|
|
|
# up-line-or-search
|
|
|
|
# expand-or-complete-prefix ## completion in the middle of a line
|
|
|
|
|
2012-08-13 18:18:56 +02:00
|
|
|
## Emacs bindings
|
|
|
|
bindkey -e
|
2012-06-15 16:54:02 +02:00
|
|
|
|
2012-08-13 18:18:56 +02:00
|
|
|
## Set '/' as a word delimiter.
|
|
|
|
autoload -U select-word-style
|
|
|
|
select-word-style bash
|
2012-06-15 16:54:02 +02:00
|
|
|
|
2014-09-23 12:46:10 +02:00
|
|
|
## Portable key codes: you can use
|
|
|
|
# ${terminfo[<capname>]}
|
|
|
|
## or
|
|
|
|
# echotc <TCap Code>
|
|
|
|
## See terminfo(5)
|
|
|
|
|
2012-08-13 18:18:56 +02:00
|
|
|
## Note that double brackets are needed to expand wildcards properly.
|
|
|
|
if [[ $TERM = *xterm* ]] ; then
|
2014-11-12 17:22:59 +01:00
|
|
|
bindkey "\e[3~" delete-char
|
|
|
|
bindkey "\e[1;5D" backward-word
|
|
|
|
bindkey "\e[1;5C" forward-word
|
|
|
|
bindkey "\eOH" beginning-of-line
|
|
|
|
bindkey "\eOF" end-of-line
|
2012-06-15 16:54:02 +02:00
|
|
|
|
2014-11-12 17:22:59 +01:00
|
|
|
bindkey "\e[Z" reverse-menu-complete # Shift+Tab
|
2012-08-13 18:18:56 +02:00
|
|
|
fi
|
2012-06-15 16:54:02 +02:00
|
|
|
|
2012-08-13 18:18:56 +02:00
|
|
|
if [[ $TERM = *rxvt* ]] ; then
|
2014-11-12 17:22:59 +01:00
|
|
|
bindkey "^w" kill-region
|
|
|
|
bindkey "\e[3~" delete-char
|
|
|
|
bindkey "\eOd" backward-word
|
|
|
|
bindkey "\eOc" forward-word
|
|
|
|
bindkey "\e[5~" beginning-of-history
|
|
|
|
bindkey "\e[6~" end-of-history
|
|
|
|
bindkey "\e[7~" beginning-of-line
|
|
|
|
bindkey "\e[8~" end-of-line
|
2012-07-13 17:39:09 +02:00
|
|
|
|
2014-11-12 17:22:59 +01:00
|
|
|
bindkey -s "\e^B" "^A^Kbrowse\n"
|
2014-09-23 12:46:10 +02:00
|
|
|
|
2014-11-12 17:22:59 +01:00
|
|
|
bindkey "\e[Z" reverse-menu-complete # Shift+Tab
|
2012-08-13 18:18:56 +02:00
|
|
|
fi
|
2012-07-13 17:39:09 +02:00
|
|
|
|
2012-06-15 16:54:02 +02:00
|
|
|
## For FreeBSD console.
|
2012-08-13 18:18:56 +02:00
|
|
|
# bindkey "\e[H" beginning-of-line
|
|
|
|
# bindkey "\e[F" end-of-line
|