Отложенная загрузка медленных плагинов

This commit is contained in:
Andrei Astafev 2021-12-07 12:03:46 +03:00
parent c1ef48141d
commit 93e084e94f
6 changed files with 36 additions and 11 deletions

5
.gitignore vendored
View File

@ -1,5 +1,6 @@
.zcompdump*
*.user.zsh
*.post.zsh *.post.zsh
*.pre.zsh *.pre.zsh
*.user.zsh
.zcalc_history
.zcompdump*
*.zwc *.zwc

View File

@ -1601,7 +1601,7 @@
# - verbose: Enable instant prompt and print a warning when detecting console output during # - verbose: Enable instant prompt and print a warning when detecting console output during
# zsh initialization. Choose this if you've never tried instant prompt, haven't # zsh initialization. Choose this if you've never tried instant prompt, haven't
# seen the warning, or if you are unsure what this all means. # seen the warning, or if you are unsure what this all means.
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload

View File

@ -8,6 +8,12 @@ do
fi fi
done done
# Отключаем некоторые плагины, если запуск в качестве подоболочки mc
# Bug: https://midnight-commander.org/ticket/4253
#if ps $PPID | grep mc; then
# export ZSH_MC_WORKAROUND=1
#fi
# Удалить дубликаты в PATH # Удалить дубликаты в PATH
typeset -U PATH typeset -U PATH

View File

@ -9,7 +9,7 @@ zmodload zsh/terminfo
autoload -Uz edit-command-line autoload -Uz edit-command-line
zle -N edit-command-line zle -N edit-command-line
bindkey -M vicmd v edit-command-line #bindkey -M vicmd v edit-command-line
autoload -Uz select-word-style autoload -Uz select-word-style
select-word-style shell select-word-style shell

View File

@ -2,6 +2,7 @@ zcomet trigger zhooks agkozak/zhooks
zcomet load willghatch/zsh-saneopt zcomet load willghatch/zsh-saneopt
zcomet load mafredri/zsh-async zcomet load mafredri/zsh-async
zcomet load romkatv/zsh-defer
export ZSHZ_CASE=smart export ZSHZ_CASE=smart
export ZSHZ_DATA="${ZSH_CACHE_DIR}/z" export ZSHZ_DATA="${ZSH_CACHE_DIR}/z"
@ -17,8 +18,6 @@ if command -v peco > /dev/null 2>&1; then
zcomet load jimeh/zsh-peco-history zcomet load jimeh/zsh-peco-history
fi fi
#ZSH_ALIAS_FINDER_AUTOMATIC=true
#zcomet load ohmyzsh plugins/alias-finder
zcomet load ohmyzsh plugins/autojump zcomet load ohmyzsh plugins/autojump
zcomet load ohmyzsh plugins/command-not-found zcomet load ohmyzsh plugins/command-not-found
zcomet load ohmyzsh plugins/common-aliases zcomet load ohmyzsh plugins/common-aliases

View File

@ -1,7 +1,7 @@
# Speed up autocomplete, force prefix mapping # Speed up autocomplete, force prefix mapping
zstyle ':completion:*' accept-exact '*(N)' zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' use-cache on zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path $ZSH_CACHE_DIR/completion zstyle ':completion:*' cache-path $ZSH_CACHE_DIR
zstyle ':completion:*:processes' command 'ps -ax' zstyle ':completion:*:processes' command 'ps -ax'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'
@ -23,8 +23,27 @@ zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*.*' loo
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^*.*' '*@*' zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^*.*' '*@*'
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->' zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'
# Вызов в этом месте и в таком порядке zcomet load zsh-users/zsh-completions
zcomet load zsh-users/zsh-syntax-highlighting
zcomet load zsh-users/zsh-history-substring-search # Вызов в этом месте и в таком порядке
#zcomet load zsh-users/zsh-autosuggestions #if [ -z "${ZSH_MC_WORKAROUND}" ]; then
# zcomet load zsh-users/zsh-autosuggestions
#fi
#zcomet load zsh-users/zsh-syntax-highlighting
#zcomet load zsh-users/zsh-history-substring-search
# Отложенная загрузка
mkdir -p ${ZCOMET_DIR}/repos/zsh-users
if [[ ! -f "${ZCOMET_DIR}/repos/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh" ]]; then
command git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions "${ZCOMET_DIR}/repos/zsh-users/zsh-autosuggestions"
fi
if [[ ! -f "${ZCOMET_DIR}/repos/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]]; then
command git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting "${ZCOMET_DIR}/repos/zsh-users/zsh-syntax-highlighting"
fi
if [[ ! -f "${ZCOMET_DIR}/repos/zsh-users/zsh-history-substring-search/zsh-history-substring-search.zsh" ]]; then
command git clone --depth=1 https://github.com/zsh-users/zsh-history-substring-search "${ZCOMET_DIR}/repos/zsh-users/zsh-history-substring-search"
fi
zsh-defer source "${ZCOMET_DIR}/repos/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh" \
"${ZCOMET_DIR}/repos/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" \
"${ZCOMET_DIR}/repos/zsh-users/zsh-history-substring-search/zsh-history-substring-search.zsh"