mirror of https://github.com/akelge/zsh
Changes to key binding for VI mode
This commit is contained in:
parent
1267b3033f
commit
9064a7bed3
|
@ -1,9 +1,19 @@
|
||||||
#######################################################################################
|
#######################################################################################
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# By default we choose emacs mode
|
||||||
|
bindkey "-e"
|
||||||
|
|
||||||
# Backward-kill-word stop on dir delimiter
|
# Backward-kill-word stop on dir delimiter
|
||||||
autoload -U select-word-style
|
autoload -U select-word-style
|
||||||
select-word-style bash
|
select-word-style bash
|
||||||
|
|
||||||
|
# History search
|
||||||
|
autoload -Uz history-search-end
|
||||||
|
|
||||||
|
zle -N history-beginning-search-backward-end history-search-end
|
||||||
|
zle -N history-beginning-search-forward-end history-search-end
|
||||||
|
|
||||||
# Command line editing in $EDITOR
|
# Command line editing in $EDITOR
|
||||||
autoload -z edit-command-line
|
autoload -z edit-command-line
|
||||||
zle -N edit-command-line
|
zle -N edit-command-line
|
||||||
|
@ -14,7 +24,6 @@ bindkey "^U" backward-kill-line
|
||||||
bindkey "\e[3~" delete-char
|
bindkey "\e[3~" delete-char
|
||||||
|
|
||||||
# Useful under iTerm
|
# Useful under iTerm
|
||||||
bindkey "-e"
|
|
||||||
bindkey "\e[H" beginning-of-line
|
bindkey "\e[H" beginning-of-line
|
||||||
bindkey "\e[1~" beginning-of-line
|
bindkey "\e[1~" beginning-of-line
|
||||||
|
|
||||||
|
@ -28,4 +37,29 @@ bindkey "\e[B" history-search-forward
|
||||||
bindkey "\e[1;3C" forward-word
|
bindkey "\e[1;3C" forward-word
|
||||||
bindkey "\e[1;3D" backward-word
|
bindkey "\e[1;3D" backward-word
|
||||||
|
|
||||||
|
|
||||||
|
# VI mode history search
|
||||||
|
bindkey -M vicmd '^[[A' history-beginning-search-backward-end \
|
||||||
|
'^[OA' history-beginning-search-backward-end \
|
||||||
|
'^[[B' history-beginning-search-forward-end \
|
||||||
|
'^[OB' history-beginning-search-forward-end
|
||||||
|
bindkey -M viins '^[[A' history-beginning-search-backward-end \
|
||||||
|
'^[OA' history-beginning-search-backward-end \
|
||||||
|
'^[[B' history-beginning-search-forward-end \
|
||||||
|
'^[OB' history-beginning-search-forward-end
|
||||||
|
|
||||||
|
bindkey -M viins "\e[H" beginning-of-line \
|
||||||
|
"\e[1~" beginning-of-line \
|
||||||
|
"^A" beginning-of-line \
|
||||||
|
"\e[F" end-of-line \
|
||||||
|
"\e[4~" end-of-line \
|
||||||
|
"^E" end-of-line
|
||||||
|
|
||||||
|
bindkey -M vicmd "\e[H" beginning-of-line \
|
||||||
|
"\e[1~" beginning-of-line \
|
||||||
|
"^A" beginning-of-line \
|
||||||
|
"\e[F" end-of-line \
|
||||||
|
"\e[4~" end-of-line \
|
||||||
|
"^E" end-of-line
|
||||||
|
|
||||||
# vim: set ts=4 sw=4 tw=0 ft=zsh :
|
# vim: set ts=4 sw=4 tw=0 ft=zsh :
|
||||||
|
|
Loading…
Reference in New Issue