From 93e084e94fe43b59dd4d5fea59d444382d075dd8 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Tue, 7 Dec 2021 12:03:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BC=D0=B5=D0=B4=D0=BB=D0=B5=D0=BD=D0=BD=D1=8B=D1=85?= =?UTF-8?q?=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 +++-- .p10k.zsh | 2 +- 15-env.zsh | 6 ++++++ 35-options.zsh | 2 +- 48-plugins.zsh | 3 +-- 85-completion.zsh | 29 ++++++++++++++++++++++++----- 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 367a897..f2413d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -.zcompdump* -*.user.zsh *.post.zsh *.pre.zsh +*.user.zsh +.zcalc_history +.zcompdump* *.zwc diff --git a/.p10k.zsh b/.p10k.zsh index 04cba59..bef6732 100644 --- a/.p10k.zsh +++ b/.p10k.zsh @@ -1601,7 +1601,7 @@ # - 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 # 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. # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload diff --git a/15-env.zsh b/15-env.zsh index d7be0d9..533b83e 100644 --- a/15-env.zsh +++ b/15-env.zsh @@ -8,6 +8,12 @@ do fi done +# Отключаем некоторые плагины, если запуск в качестве подоболочки mc +# Bug: https://midnight-commander.org/ticket/4253 +#if ps $PPID | grep mc; then +# export ZSH_MC_WORKAROUND=1 +#fi + # Удалить дубликаты в PATH typeset -U PATH diff --git a/35-options.zsh b/35-options.zsh index 2f5cd28..8bb09b6 100644 --- a/35-options.zsh +++ b/35-options.zsh @@ -9,7 +9,7 @@ zmodload zsh/terminfo autoload -Uz 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 select-word-style shell diff --git a/48-plugins.zsh b/48-plugins.zsh index c7d2405..1a838b5 100644 --- a/48-plugins.zsh +++ b/48-plugins.zsh @@ -2,6 +2,7 @@ zcomet trigger zhooks agkozak/zhooks zcomet load willghatch/zsh-saneopt zcomet load mafredri/zsh-async +zcomet load romkatv/zsh-defer export ZSHZ_CASE=smart 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 fi -#ZSH_ALIAS_FINDER_AUTOMATIC=true -#zcomet load ohmyzsh plugins/alias-finder zcomet load ohmyzsh plugins/autojump zcomet load ohmyzsh plugins/command-not-found zcomet load ohmyzsh plugins/common-aliases diff --git a/85-completion.zsh b/85-completion.zsh index c1b2680..60302e7 100644 --- a/85-completion.zsh +++ b/85-completion.zsh @@ -1,7 +1,7 @@ # Speed up autocomplete, force prefix mapping zstyle ':completion:*' accept-exact '*(N)' 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:*:*: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-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->' -# Вызов в этом месте и в таком порядке -zcomet load zsh-users/zsh-syntax-highlighting -zcomet load zsh-users/zsh-history-substring-search -#zcomet load zsh-users/zsh-autosuggestions +zcomet load zsh-users/zsh-completions + +# Вызов в этом месте и в таком порядке +#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"