diff --git a/zsh/vi-mode b/zsh/vi-mode index 73ff5b6..22f95f9 100644 --- a/zsh/vi-mode +++ b/zsh/vi-mode @@ -34,3 +34,12 @@ zle -N zle-keymap-select zle-line-init() { set_cursor_shape bar } zle -N zle-line-init +# Search through history in insert mode. +bindkey -M viins '^j' history-beginning-search-forward +bindkey -M viins '^k' history-beginning-search-backward + +# Restore some common and useful emacs mode shortcut. +bindkey -M viins '^a' vi-beginning-of-line +bindkey -M viins '^e' vi-end-of-line +bindkey -M viins '^l' clear-screen + diff --git a/zsh/zshrc b/zsh/zshrc index 2d12e1f..66d89d9 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -26,12 +26,4 @@ zstyle ':completion:*' menu select # bindkey -M menuselect 'l' vi-forward-char # bindkey -M menuselect 'j' vi-down-line-or-history -# Search through history in insert mode. -bindkey -M viins '^j' history-beginning-search-forward -bindkey -M viins '^k' history-beginning-search-backward - -# Restore some common and useful emacs mode shortcut. -bindkey -M viins '^a' vi-beginning-of-line -bindkey -M viins '^e' vi-end-of-line -bindkey -M viins '^l' clear-screen