2012-11-14 03:49:01 +08:00
|
|
|
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
|
|
|
|
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
|
|
|
|
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
|
|
|
|
|
|
|
|
bindkey -v # Use vi key bindings
|
2017-03-10 19:43:10 +08:00
|
|
|
|
|
|
|
# VI MODE KEYBINDINGS (ins mode)
|
|
|
|
bindkey -M viins '^a' beginning-of-line
|
|
|
|
bindkey -M viins '^e' end-of-line
|
|
|
|
# bindkey -M viins '^k' kill-line
|
|
|
|
bindkey -M viins '^r' history-incremental-pattern-search-backward
|
|
|
|
bindkey -M viins '^s' history-incremental-pattern-search-forward
|
|
|
|
bindkey -M viins '^p' up-line-or-history
|
|
|
|
bindkey -M viins '^n' down-line-or-history
|
|
|
|
bindkey -M viins '^y' yank
|
|
|
|
bindkey -M viins '^w' backward-kill-word
|
|
|
|
bindkey -M viins '^u' backward-kill-line
|
|
|
|
bindkey -M viins '^?' backward-delete-char
|
|
|
|
bindkey -M viins '^_' undo
|
|
|
|
bindkey -M viins '^x^r' redisplay
|
|
|
|
bindkey -M viins '\eOH' beginning-of-line # Home
|
|
|
|
bindkey -M viins '\eOF' end-of-line # End
|
|
|
|
bindkey -M viins '\e[2~' overwrite-mode # Insert
|
|
|
|
bindkey -M viins '\ef' forward-word # Alt-f
|
|
|
|
bindkey -M viins '\eb' backward-word # Alt-b
|
|
|
|
bindkey -M viins '\ed' kill-word # Alt-d
|
|
|
|
|
|
|
|
|
|
|
|
# VI MODE KEYBINDINGS (cmd mode)
|
|
|
|
bindkey -M vicmd '^a' beginning-of-line
|
|
|
|
bindkey -M vicmd '^e' end-of-line
|
|
|
|
# bindkey -M vicmd '^k' kill-line
|
|
|
|
bindkey -M vicmd '^r' history-incremental-pattern-search-backward
|
|
|
|
bindkey -M vicmd '^s' history-incremental-pattern-search-forward
|
|
|
|
bindkey -M vicmd '^p' up-line-or-history
|
|
|
|
bindkey -M vicmd '^n' down-line-or-history
|
|
|
|
bindkey -M vicmd '^y' yank
|
|
|
|
bindkey -M vicmd '^w' backward-kill-word
|
|
|
|
bindkey -M vicmd '^u' backward-kill-line
|
|
|
|
bindkey -M vicmd '/' vi-history-search-forward
|
|
|
|
bindkey -M vicmd '?' vi-history-search-backward
|
|
|
|
bindkey -M vicmd '^_' undo
|
|
|
|
bindkey -M vicmd '\ef' forward-word # Alt-f
|
|
|
|
bindkey -M vicmd '\eb' backward-word # Alt-b
|
|
|
|
bindkey -M vicmd '\ed' kill-word # Alt-d
|
|
|
|
bindkey -M vicmd '\e[5~' history-beginning-search-backward # PageUp
|
|
|
|
bindkey -M vicmd '\e[6~' history-beginning-search-forward # PageDown
|
|
|
|
|
|
|
|
|
2012-11-14 03:49:01 +08:00
|
|
|
|
|
|
|
# emacs style
|
|
|
|
bindkey '^a' beginning-of-line
|
|
|
|
bindkey '^e' end-of-line
|
2015-06-28 06:49:28 +08:00
|
|
|
|
|
|
|
# Make numpad enter work
|
|
|
|
bindkey -s "^[Op" "0"
|
|
|
|
bindkey -s "^[Ol" "."
|
|
|
|
bindkey -s "^[OM" "^M"
|
|
|
|
|