comparison dot_zshrc @ 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 89769aa79628
comparison
equal deleted inserted replaced
539:8e2e42add3af 540:9036f18c5ad4
1 # vim:ft=zsh 1 # vim:ft=zsh
2
3 source ~/.zsh/zsh-history-substring-search.zsh
4 export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=green,fg=black'
5
6 source ~/.zsh/zsh-autosuggestions.zsh
7
8 source ~/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
9
10 source ~/.zsh/zsh-histdb/zsh-histdb.plugin.zsh
11 source ~/.zsh/fzf-histdb.zsh
12
13 _zsh_autosuggest_strategy_histdb_top_here() {
14 local query="select commands.argv from
15 history left join commands on history.command_id = commands.rowid
16 left join places on history.place_id = places.rowid
17 where places.dir LIKE '$(sql_escape $PWD)%'
18 and commands.argv LIKE '$(sql_escape $1)%'
19 group by commands.argv order by count(*) desc limit 1"
20 suggestion=$(_histdb_query "$query")
21 }
22
23 ZSH_AUTOSUGGEST_STRATEGY=histdb_top_here
24 2
25 fpath=(~/.zsh/completions $fpath) 3 fpath=(~/.zsh/completions $fpath)
26 4
27 export TERM=xterm-256color 5 export TERM=xterm-256color
28 6
96 bindkey "$terminfo[kcud1]" history-substring-search-down 74 bindkey "$terminfo[kcud1]" history-substring-search-down
97 bindkey '^p' history-substring-search-up 75 bindkey '^p' history-substring-search-up
98 bindkey '^n' history-substring-search-down 76 bindkey '^n' history-substring-search-down
99 77
100 bindkey '^f' autosuggest-accept 78 bindkey '^f' autosuggest-accept
101
102 bindkey '^u' push-line-or-edit
103 79
104 zmodload zsh/complist 80 zmodload zsh/complist
105 bindkey -M menuselect 'h' vi-backward-char 81 bindkey -M menuselect 'h' vi-backward-char
106 bindkey -M menuselect 'k' vi-up-line-or-history 82 bindkey -M menuselect 'k' vi-up-line-or-history
107 bindkey -M menuselect 'j' vi-down-line-or-history 83 bindkey -M menuselect 'j' vi-down-line-or-history
256 export RIPGREP_CONFIG_PATH=$HOME/.config/ripgrep/ripgreprc 232 export RIPGREP_CONFIG_PATH=$HOME/.config/ripgrep/ripgreprc
257 export BAT_CONFIG_PATH=$HOME/.config/bat/config 233 export BAT_CONFIG_PATH=$HOME/.config/bat/config
258 234
259 [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 235 [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
260 236
261 bindkey '^r' histdb-fzf-widget 237 bindkey '^t' push-line-or-edit
262 238
263 [ -f ~/.zshrc.local ] && source ~/.zshrc.local 239 [ -f ~/.zshrc.local ] && source ~/.zshrc.local
264 240
265 # Must run after brew is loaded 241 # Must run after brew is loaded
266 export SUDO_EDITOR=$(which nvim) 242 export SUDO_EDITOR=$(which nvim)
267 eval "$(direnv hook zsh)" 243 eval "$(direnv hook zsh)"
244
245 source ~/.zsh/zsh-history-substring-search.zsh
246 export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=green,fg=black'
247
248 source ~/.zsh/zsh-autosuggestions.zsh
249
250 source ~/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
251
252 source ~/.zsh/zsh-histdb/sqlite-history.zsh
253 source ~/.zsh/fzf-histdb.zsh
254
255 bindkey '^r' histdb-fzf-widget
256
257 _zsh_autosuggest_strategy_histdb_top_here() {
258 local query="select commands.argv from
259 history left join commands on history.command_id = commands.rowid
260 left join places on history.place_id = places.rowid
261 where places.dir LIKE '$(sql_escape $PWD)%'
262 and commands.argv LIKE '$(sql_escape $1)%'
263 group by commands.argv order by count(*) desc limit 1"
264 suggestion=$(_histdb_query "$query")
265 }
266
267 ZSH_AUTOSUGGEST_STRATEGY=histdb_top_here