diff --git a/dotfiles/zsh/zshrc b/dotfiles/zsh/zshrc index eae4b6b..087aa91 100644 --- a/dotfiles/zsh/zshrc +++ b/dotfiles/zsh/zshrc @@ -18,10 +18,6 @@ zstyle ':completion:*' menu select setopt COMPLETE_ALIASES -# ENFORCE VI MODE -bindkey -v - - # KEY BINDINGS # create a zkbd compatible hash; # to add other keys to this hash, see: man 5 terminfo @@ -65,13 +61,31 @@ if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then fi +# VI MODE +bindkey -v +# Match ESC to ~/.vimrc +bindkey -M viins "jk" "${key[Esc]}" +# Switch mode faster +export KEYTIMEOUT=1 +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -v '^?' backward-delete-char + + # HISTORY SEARCH +HISTSIZE=10000 +SAVEHIST=10000 +HISTFILE=~/.zhistory autoload -Uz up-line-or-beginning-search down-line-or-beginning-search zle -N up-line-or-beginning-search zle -N down-line-or-beginning-search - [[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-beginning-search [[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-beginning-search +# and for jk +bindkey -M vicmd "k" up-line-or-beginning-search +bindkey -M vicmd "j" down-line-or-beginning-search # HELP COMMAND