3ad92a57f194f2a00a0a4c3e3241ce494e791c02

Author
Douglas Drumond <douglas@cafelinear.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Add ctrl-r, ctrl-a and ctrl-e support in vi-mode (#4994)

* Add ctrl-r support in vi-mode to perform backward search in history
* Add ctrl-a support to move to bol in vi-mode
* Add ctrl-e support to move to eol in vi-mode

Signed-off-by: Douglas Drumond <douglas@cafelinear.com>

Diff

 1diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
 2index 0e2af5dcea8889703cead3d201d3e118c6a1a321..dee694b9a51b1f352bb68ef5569dfeb4577e96d1 100644
 3--- a/plugins/vi-mode/vi-mode.plugin.zsh
 4+++ b/plugins/vi-mode/vi-mode.plugin.zsh
 5@@ -28,6 +28,13 @@ bindkey '^?' backward-delete-char
 6 bindkey '^h' backward-delete-char
 7 bindkey '^w' backward-kill-word
 8 
 9+# allow ctrl-r to perform backward search in history
10+bindkey '^r' history-incremental-search-backward
11+
12+# allow ctrl-a and ctrl-e to move to beginning/end of line
13+bindkey '^a' beginning-of-line
14+bindkey '^e' end-of-line
15+
16 # if mode indicator wasn't setup by theme, define default
17 if [[ "$MODE_INDICATOR" == "" ]]; then
18   MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"