comparison dot_zshrc @ 658:77f3f615e4bf

Add zsh-defer to load zsh prompt faster (I think?)
author zegervdv <zegervdv@me.com>
date Sat, 24 Sep 2022 16:02:02 +0000
parents 3b903fda0c14
children e1a7072165ac
comparison
equal deleted inserted replaced
657:3b903fda0c14 658:77f3f615e4bf
1 # vim:ft=zsh 1 # vim:ft=zsh
2
3 source ~/.zsh/zsh-defer.zsh
2 4
3 fpath=(~/.zsh/completions $fpath) 5 fpath=(~/.zsh/completions $fpath)
4 6
5 export TERM=xterm-256color 7 export TERM=xterm-256color
6 export COLORTERM=truecolor 8 export COLORTERM=truecolor
52 zstyle ':vcs_info:*' formats '%F{4}%s%F{5}%F{3} @ %F{2}%b%f' 54 zstyle ':vcs_info:*' formats '%F{4}%s%F{5}%F{3} @ %F{2}%b%f'
53 zstyle ':vcs_info:hg*:*' use-simple true 55 zstyle ':vcs_info:hg*:*' use-simple true
54 56
55 precmd () { vcs_info } 57 precmd () { vcs_info }
56 58
57 RPROMPT='${vcs_info_msg_0_} ${vim_mode}' 59 zsh-defer -c 'RPROMPT="\${vcs_info_msg_0_} \${vim_mode}"'
58 60
59 zmodload -i zsh/complist 61 zmodload -i zsh/complist
60 62
61 bindkey -v 63 bindkey -v
62 64
236 238
237 # Must run after brew is loaded 239 # Must run after brew is loaded
238 export SUDO_EDITOR=$(which nvim) 240 export SUDO_EDITOR=$(which nvim)
239 eval "$(direnv hook zsh)" 241 eval "$(direnv hook zsh)"
240 242
241 source ~/.zsh/zsh-history-substring-search.zsh 243 zsh-defer source ~/.zsh/zsh-history-substring-search.zsh
242 export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=cyan,fg=white' 244 export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=cyan,fg=white'
243 245
244 source ~/.zsh/zsh-autosuggestions.zsh 246 zsh-defer source ~/.zsh/zsh-autosuggestions.zsh
245 247
246 source ~/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 248 zsh-defer source ~/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
247 249
248 export HISTDB_FILE="${HOME}/.histdb/zsh-history-$(hostname).db" 250 export HISTDB_FILE="${HOME}/.histdb/zsh-history-$(hostname).db"
249 source ~/.zsh/zsh-histdb/sqlite-history.zsh 251 zsh-defer source ~/.zsh/zsh-histdb/sqlite-history.zsh
250 source ~/.zsh/zsh-histdb-skim/zsh-histdb-skim.zsh 252 zsh-defer source ~/.zsh/zsh-histdb-skim/zsh-histdb-skim.zsh
251 253
252 source ~/.zsh/jq-zsh-plugin/jq.plugin.zsh 254 zsh-defer source ~/.zsh/jq-zsh-plugin/jq.plugin.zsh
253 255
254 # The plugin will auto execute this zvm_after_init function 256 # The plugin will auto execute this zvm_after_init function
255 function zvm_after_init() { 257 function zvm_after_init() {
256 [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 258 [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
257 bindkey '^r' histdb-skim-widget 259 bindkey '^r' histdb-skim-widget
270 bindkey '^n' history-substring-search-down 272 bindkey '^n' history-substring-search-down
271 273
272 bindkey '^f' autosuggest-accept 274 bindkey '^f' autosuggest-accept
273 } 275 }
274 276
275 source ~/.zsh/zsh-vi-mode.zsh 277 zsh-defer source ~/.zsh/zsh-vi-mode.zsh
276 278
277 _zsh_autosuggest_strategy_histdb_top_here() { 279 _zsh_autosuggest_strategy_histdb_top_here() {
278 local query="select commands.argv from 280 local query="select commands.argv from
279 history left join commands on history.command_id = commands.rowid 281 history left join commands on history.command_id = commands.rowid
280 left join places on history.place_id = places.rowid 282 left join places on history.place_id = places.rowid