Mercurial > dotfiles
changeset 540:9036f18c5ad4
restructure zshrc to load all paths before loading plugins
author | zegervdv <zegervdv@me.com> |
---|---|
date | Fri, 28 Jan 2022 09:11:34 +0100 |
parents | 8e2e42add3af |
children | 80622cb35a3e |
files | dot_zshrc |
diffstat | 1 files changed, 25 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/dot_zshrc Thu Jan 27 16:33:56 2022 +0100 +++ b/dot_zshrc Fri Jan 28 09:11:34 2022 +0100 @@ -1,27 +1,5 @@ # vim:ft=zsh -source ~/.zsh/zsh-history-substring-search.zsh -export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=green,fg=black' - -source ~/.zsh/zsh-autosuggestions.zsh - -source ~/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh - -source ~/.zsh/zsh-histdb/zsh-histdb.plugin.zsh -source ~/.zsh/fzf-histdb.zsh - -_zsh_autosuggest_strategy_histdb_top_here() { - local query="select commands.argv from -history left join commands on history.command_id = commands.rowid -left join places on history.place_id = places.rowid -where places.dir LIKE '$(sql_escape $PWD)%' -and commands.argv LIKE '$(sql_escape $1)%' -group by commands.argv order by count(*) desc limit 1" - suggestion=$(_histdb_query "$query") -} - -ZSH_AUTOSUGGEST_STRATEGY=histdb_top_here - fpath=(~/.zsh/completions $fpath) export TERM=xterm-256color @@ -99,8 +77,6 @@ bindkey '^f' autosuggest-accept -bindkey '^u' push-line-or-edit - zmodload zsh/complist bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'k' vi-up-line-or-history @@ -258,10 +234,34 @@ [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -bindkey '^r' histdb-fzf-widget +bindkey '^t' push-line-or-edit [ -f ~/.zshrc.local ] && source ~/.zshrc.local # Must run after brew is loaded export SUDO_EDITOR=$(which nvim) eval "$(direnv hook zsh)" + +source ~/.zsh/zsh-history-substring-search.zsh +export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=green,fg=black' + +source ~/.zsh/zsh-autosuggestions.zsh + +source ~/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh + +source ~/.zsh/zsh-histdb/sqlite-history.zsh +source ~/.zsh/fzf-histdb.zsh + +bindkey '^r' histdb-fzf-widget + +_zsh_autosuggest_strategy_histdb_top_here() { + local query="select commands.argv from +history left join commands on history.command_id = commands.rowid +left join places on history.place_id = places.rowid +where places.dir LIKE '$(sql_escape $PWD)%' +and commands.argv LIKE '$(sql_escape $1)%' +group by commands.argv order by count(*) desc limit 1" + suggestion=$(_histdb_query "$query") +} + +ZSH_AUTOSUGGEST_STRATEGY=histdb_top_here