From 3b8ff75dfacfcc44cc97552613cbe124bd0c6012 Mon Sep 17 00:00:00 2001 From: Nadeem Ahmad Date: Thu, 6 Aug 2015 21:00:53 -0700 Subject: [PATCH] Add additional keybindings in vi-mode ctrl-r: To allow backward history search ctrl-s: To allow forward history search ctrl-a: To allow navigation to beginning of line ctrl-e: To allow navigation to end of line --- plugins/vi-mode/vi-mode.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 0e2af5dce..ae6eb1a0f 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -28,6 +28,15 @@ bindkey '^?' backward-delete-char bindkey '^h' backward-delete-char bindkey '^w' backward-kill-word +# allow ctrl-r for searching history backward (insert mode) +bindkey '^r' history-incremental-search-backward +# allow ctrl-s for searching history forward (insert mode) +bindkey '^s' history-incremental-search-forward +# allow ctrl-a to go to beginning of line (insert mode) +bindkey '^a' beginning-of-line +# allow ctrl-e to go to end of line (insert mode) +bindkey '^e' end-of-line + # if mode indicator wasn't setup by theme, define default if [[ "$MODE_INDICATOR" == "" ]]; then MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"