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
+8 -7
View File
@@ -144,19 +144,16 @@ alias wakemac='ssh vps "wakeonlan -i 192.168.1.255 FC:34:97:E1:08:E9"'
alias zshrc='${EDITOR} ~/.config/zsh/.zshrc'
alias reload='source ~/.config/zsh/.zshrc'
alias path='echo $PATH | tr ":" "\n"'
# Использовать bat вместо cat, если установлен
if command -v bat &>/dev/null; then
alias cat='bat'
fi
alias h='history'
alias c='clear'
alias x='exit'
alias rsend='sudo rsync -avhP --stats'
alias wakemac='ssh vps "wakeonlan -i 192.168.1.255 FC:34:97:E1:08:E9"'
# Использовать bat вместо cat, если установлен
if command -v bat &>/dev/null; then
alias cat='bat'
fi
# Быстрое обновление системы (для разных дистрибутивов)
if command -v apt &>/dev/null; then
@@ -204,3 +201,7 @@ alias ua-update-all='export TMPFILE="$(mktemp)"; \
&& sudo mv $TMPFILE /etc/pacman.d/mirrorlist \
&& paru -Syyu --noconfirm \
&& ua-drop-caches'
alias codex='proxy-on && codex'
alias claude='proxy-on && claude'
alias opencode='proxy-on && opencode'
+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
+5 -1
View File
@@ -63,6 +63,7 @@ export PATH="${CARGO_HOME}/bin:${PATH}"
# ═══ Локальные бинарники ═══════════════════════════════════
export PATH="${HOME}/.local/bin:${PATH}"
export PATH="${HOME}/.opencode/bin:${PATH}"
# ═══ Цвета ═════════════════════════════════════════════════
export CLICOLOR=1
@@ -93,4 +94,7 @@ if command -v direnv >/dev/null 2>&1; then
eval "$(direnv hook zsh)"
fi
export SSH_AUTH_SOCK='/home/ada/.bitwarden-ssh-agent.sock'
# export SSH_AUTH_SOCK='/home/ada/.bitwarden-ssh-agent.sock'
export SAL_USE_VCLPLUGIN=gtk3
export GDK_SCALE=1
+1 -7
View File
@@ -64,12 +64,6 @@ if command -v fzf &>/dev/null; then
zstyle ':fzf-tab:complete:*:*' fzf-preview 'less ${(Q)realpath} 2>/dev/null || eza -1 --color=always ${(Q)realpath} 2>/dev/null || ls -1 --color=always ${(Q)realpath}'
fi
# ═══ Навигация ═════════════════════════════════════════════
# zoxide - умный cd с историей
if command -v zoxide &>/dev/null; then
eval "$(zoxide init zsh)"
fi
# ═══ Git ═══════════════════════════════════════════════════
# Быстрые git алиасы и функции
zinit ice wait lucid
@@ -103,5 +97,5 @@ fi
# ═══ Подсветка синтаксиса (ПОСЛЕДНИЙ плагин) ═══════════════
# zsh-syntax-highlighting - ОБЯЗАТЕЛЬНО загружать последним
# Это гарантирует, что все виджеты уже определены
zinit ice wait lucid atinit'zpcompinit; zpcdreplay'
zinit ice wait lucid atinit'zpcdreplay'
zinit light zsh-users/zsh-syntax-highlighting