zsh: fix completion duplication, remove dead code and duplicates

This commit is contained in:
Dmitry
2026-05-13 18:46:48 +03:00
parent a87c41ddd8
commit 462dc51247
5 changed files with 31 additions and 65 deletions
+4 -12
View File
@@ -39,7 +39,6 @@ zstyle ':completion:*' matcher-list \
# ═══ Цвета ═════════════════════════════════════════════════
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
# ═══ Процессы ══════════════════════════════════════════════
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
@@ -60,17 +59,11 @@ zstyle ':completion:*' list-dirs-first true
zstyle ':completion:*:cd:*' ignore-parents parent pwd
# ═══ Хосты ═════════════════════════════════════════════════
zstyle ':completion:*:ssh:*' hosts off
zstyle ':completion:*:scp:*' hosts off
# Читать хосты из ~/.ssh/config
if [[ -f ~/.ssh/config ]]; then
h=()
if [[ -r ~/.ssh/config ]]; then
h=(${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
zstyle ':completion:*:ssh:*' hosts $h
zstyle ':completion:*:scp:*' hosts $h
if [[ -r ~/.ssh/config ]]; then
local _ssh_hosts=(${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
zstyle ':completion:*:ssh:*' hosts $_ssh_hosts
zstyle ':completion:*:scp:*' hosts $_ssh_hosts
fi
# ═══ Man страницы ══════════════════════════════════════════
@@ -91,4 +84,3 @@ zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
# ═══ Расширения ════════════════════════════════════════════
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' expand yes