# HG changeset patch # User zegervdv # Date 1643490753 -3600 # Node ID 89769aa796280b34696b294fb1d134c4e0bca348 # Parent 80622cb35a3ef710177f95fa580cf045799f4ef6 add zsh-vi-mode plugin diff -r 80622cb35a3e -r 89769aa79628 .chezmoiexternal.toml --- a/.chezmoiexternal.toml Fri Jan 28 16:36:32 2022 +0100 +++ b/.chezmoiexternal.toml Sat Jan 29 22:12:33 2022 +0100 @@ -53,6 +53,11 @@ url = "https://github.com/m42e/zsh-histdb-fzf/raw/master/fzf-histdb.zsh" refreshPeriod = "168h" +[".zsh/zsh-vi-mode.zsh"] + type = "file" + url = "https://github.com/jeffreytse/zsh-vi-mode/raw/master/zsh-vi-mode.zsh" + refreshPeriod = "168h" + [".zsh/completions/_fd"] type = "file" url = "https://github.com/sharkdp/fd/raw/master/contrib/completion/_fd" diff -r 80622cb35a3e -r 89769aa79628 dot_zshrc --- a/dot_zshrc Fri Jan 28 16:36:32 2022 +0100 +++ b/dot_zshrc Sat Jan 29 22:12:33 2022 +0100 @@ -68,15 +68,6 @@ bindkey -v -bindkey '^[[A' history-substring-search-up -bindkey '^[[B' history-substring-search-down -bindkey "$terminfo[kcuu1]" history-substring-search-up -bindkey "$terminfo[kcud1]" history-substring-search-down -bindkey '^p' history-substring-search-up -bindkey '^n' history-substring-search-down - -bindkey '^f' autosuggest-accept - zmodload zsh/complist bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'k' vi-up-line-or-history @@ -232,9 +223,6 @@ export RIPGREP_CONFIG_PATH=$HOME/.config/ripgrep/ripgreprc export BAT_CONFIG_PATH=$HOME/.config/bat/config -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - -bindkey '^t' push-line-or-edit [ -f ~/.zshrc.local ] && source ~/.zshrc.local @@ -252,7 +240,23 @@ source ~/.zsh/zsh-histdb/sqlite-history.zsh source ~/.zsh/fzf-histdb.zsh -bindkey '^r' histdb-fzf-widget +# The plugin will auto execute this zvm_after_init function +function zvm_after_init() { + [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + bindkey '^r' histdb-fzf-widget + bindkey '^t' push-line-or-edit + + bindkey '^[[A' history-substring-search-up + bindkey '^[[B' history-substring-search-down + bindkey "$terminfo[kcuu1]" history-substring-search-up + bindkey "$terminfo[kcud1]" history-substring-search-down + bindkey '^p' history-substring-search-up + bindkey '^n' history-substring-search-down + + bindkey '^f' autosuggest-accept +} + +source ~/.zsh/zsh-vi-mode.zsh _zsh_autosuggest_strategy_histdb_top_here() { local query="select commands.argv from