zsh: fix completion duplication, remove dead code and duplicates
This commit is contained in:
@@ -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 zshrc='${EDITOR} ~/.config/zsh/.zshrc'
|
||||||
alias reload='source ~/.config/zsh/.zshrc'
|
alias reload='source ~/.config/zsh/.zshrc'
|
||||||
alias path='echo $PATH | tr ":" "\n"'
|
alias path='echo $PATH | tr ":" "\n"'
|
||||||
|
|
||||||
# Использовать bat вместо cat, если установлен
|
|
||||||
if command -v bat &>/dev/null; then
|
|
||||||
alias cat='bat'
|
|
||||||
fi
|
|
||||||
|
|
||||||
alias h='history'
|
alias h='history'
|
||||||
alias c='clear'
|
alias c='clear'
|
||||||
alias x='exit'
|
alias x='exit'
|
||||||
alias rsend='sudo rsync -avhP --stats'
|
alias rsend='sudo rsync -avhP --stats'
|
||||||
alias wakemac='ssh vps "wakeonlan -i 192.168.1.255 FC:34:97:E1:08:E9"'
|
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
|
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 \
|
&& sudo mv $TMPFILE /etc/pacman.d/mirrorlist \
|
||||||
&& paru -Syyu --noconfirm \
|
&& paru -Syyu --noconfirm \
|
||||||
&& ua-drop-caches'
|
&& ua-drop-caches'
|
||||||
|
|
||||||
|
alias codex='proxy-on && codex'
|
||||||
|
alias claude='proxy-on && claude'
|
||||||
|
alias opencode='proxy-on && opencode'
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ zstyle ':completion:*' matcher-list \
|
|||||||
|
|
||||||
# ═══ Цвета ═════════════════════════════════════════════════
|
# ═══ Цвета ═════════════════════════════════════════════════
|
||||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
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'
|
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:*:cd:*' ignore-parents parent pwd
|
||||||
|
|
||||||
# ═══ Хосты ═════════════════════════════════════════════════
|
# ═══ Хосты ═════════════════════════════════════════════════
|
||||||
zstyle ':completion:*:ssh:*' hosts off
|
|
||||||
zstyle ':completion:*:scp:*' hosts off
|
|
||||||
|
|
||||||
# Читать хосты из ~/.ssh/config
|
# Читать хосты из ~/.ssh/config
|
||||||
if [[ -f ~/.ssh/config ]]; then
|
|
||||||
h=()
|
|
||||||
if [[ -r ~/.ssh/config ]]; then
|
if [[ -r ~/.ssh/config ]]; then
|
||||||
h=(${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
|
local _ssh_hosts=(${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
|
||||||
fi
|
zstyle ':completion:*:ssh:*' hosts $_ssh_hosts
|
||||||
zstyle ':completion:*:ssh:*' hosts $h
|
zstyle ':completion:*:scp:*' hosts $_ssh_hosts
|
||||||
zstyle ':completion:*:scp:*' hosts $h
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ═══ Man страницы ══════════════════════════════════════════
|
# ═══ Man страницы ══════════════════════════════════════════
|
||||||
@@ -91,4 +84,3 @@ zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
|
|||||||
|
|
||||||
# ═══ Расширения ════════════════════════════════════════════
|
# ═══ Расширения ════════════════════════════════════════════
|
||||||
zstyle ':completion:*' squeeze-slashes true
|
zstyle ':completion:*' squeeze-slashes true
|
||||||
zstyle ':completion:*' expand yes
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export PATH="${CARGO_HOME}/bin:${PATH}"
|
|||||||
|
|
||||||
# ═══ Локальные бинарники ═══════════════════════════════════
|
# ═══ Локальные бинарники ═══════════════════════════════════
|
||||||
export PATH="${HOME}/.local/bin:${PATH}"
|
export PATH="${HOME}/.local/bin:${PATH}"
|
||||||
|
export PATH="${HOME}/.opencode/bin:${PATH}"
|
||||||
|
|
||||||
# ═══ Цвета ═════════════════════════════════════════════════
|
# ═══ Цвета ═════════════════════════════════════════════════
|
||||||
export CLICOLOR=1
|
export CLICOLOR=1
|
||||||
@@ -93,4 +94,7 @@ if command -v direnv >/dev/null 2>&1; then
|
|||||||
eval "$(direnv hook zsh)"
|
eval "$(direnv hook zsh)"
|
||||||
fi
|
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
|
||||||
@@ -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}'
|
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
|
fi
|
||||||
|
|
||||||
# ═══ Навигация ═════════════════════════════════════════════
|
|
||||||
# zoxide - умный cd с историей
|
|
||||||
if command -v zoxide &>/dev/null; then
|
|
||||||
eval "$(zoxide init zsh)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ═══ Git ═══════════════════════════════════════════════════
|
# ═══ Git ═══════════════════════════════════════════════════
|
||||||
# Быстрые git алиасы и функции
|
# Быстрые git алиасы и функции
|
||||||
zinit ice wait lucid
|
zinit ice wait lucid
|
||||||
@@ -103,5 +97,5 @@ fi
|
|||||||
# ═══ Подсветка синтаксиса (ПОСЛЕДНИЙ плагин) ═══════════════
|
# ═══ Подсветка синтаксиса (ПОСЛЕДНИЙ плагин) ═══════════════
|
||||||
# zsh-syntax-highlighting - ОБЯЗАТЕЛЬНО загружать последним
|
# zsh-syntax-highlighting - ОБЯЗАТЕЛЬНО загружать последним
|
||||||
# Это гарантирует, что все виджеты уже определены
|
# Это гарантирует, что все виджеты уже определены
|
||||||
zinit ice wait lucid atinit'zpcompinit; zpcdreplay'
|
zinit ice wait lucid atinit'zpcdreplay'
|
||||||
zinit light zsh-users/zsh-syntax-highlighting
|
zinit light zsh-users/zsh-syntax-highlighting
|
||||||
|
|||||||
+13
-38
@@ -3,59 +3,34 @@
|
|||||||
# ════════════════════════════════════════════════════════════
|
# ════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
# ═══ Powerlevel10k Instant Prompt ══════════════════════════
|
# ═══ Powerlevel10k Instant Prompt ══════════════════════════
|
||||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
|
||||||
# Initialization code that may require console input (password prompts, [y/n]
|
|
||||||
# confirmations, etc.) must go above this block; everything else may go below.
|
|
||||||
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Путь к конфигурации zsh
|
|
||||||
export ZDOTDIR="${ZDOTDIR:-${HOME}/.config/zsh}"
|
|
||||||
ZSH_CONFIG_DIR="${ZDOTDIR}/config"
|
|
||||||
|
|
||||||
# ═══ Zinit (Plugin Manager) ════════════════════════════════
|
# ═══ Zinit (Plugin Manager) ════════════════════════════════
|
||||||
# Автоматическая установка zinit при первом запуске
|
|
||||||
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
||||||
if [[ ! -d "$ZINIT_HOME" ]]; then
|
if [[ ! -d "$ZINIT_HOME" ]]; then
|
||||||
print -P "%F{blue}▓▒░ Установка zinit...%f"
|
print -P "%F{blue}▓▒░ Установка zinit...%f"
|
||||||
mkdir -p "$(dirname $ZINIT_HOME)"
|
mkdir -p "$(dirname $ZINIT_HOME)"
|
||||||
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Загрузка zinit
|
|
||||||
source "${ZINIT_HOME}/zinit.zsh"
|
source "${ZINIT_HOME}/zinit.zsh"
|
||||||
|
|
||||||
# ═══ Загрузка модулей ══════════════════════════════════════
|
# ═══ Загрузка модулей ══════════════════════════════════════
|
||||||
# Порядок загрузки важен!
|
ZSH_CONFIG_DIR="${ZDOTDIR}/config"
|
||||||
source "${ZSH_CONFIG_DIR}/env.zsh" # Переменные окружения
|
source "${ZSH_CONFIG_DIR}/env.zsh"
|
||||||
source "${ZSH_CONFIG_DIR}/options.zsh" # Настройки оболочки
|
source "${ZSH_CONFIG_DIR}/options.zsh"
|
||||||
source "${ZSH_CONFIG_DIR}/plugins.zsh" # Плагины через zinit
|
source "${ZSH_CONFIG_DIR}/plugins.zsh"
|
||||||
source "${ZSH_CONFIG_DIR}/completion.zsh" # Автодополнение
|
source "${ZSH_CONFIG_DIR}/completion.zsh"
|
||||||
source "${ZSH_CONFIG_DIR}/aliases.zsh" # Алиасы
|
source "${ZSH_CONFIG_DIR}/aliases.zsh"
|
||||||
source "${ZSH_CONFIG_DIR}/functions.zsh" # Пользовательские функции
|
source "${ZSH_CONFIG_DIR}/functions.zsh"
|
||||||
source "${ZSH_CONFIG_DIR}/keybindings.zsh" # Горячие клавиши
|
source "${ZSH_CONFIG_DIR}/keybindings.zsh"
|
||||||
source "${ZSH_CONFIG_DIR}/prompt.zsh" # Настройка промпта (starship)
|
source "${ZSH_CONFIG_DIR}/prompt.zsh"
|
||||||
|
|
||||||
|
# ═══ Локальные настройки ═══════════════════════════════════
|
||||||
# ═══ Локальные настройки (опционально) ═════════════════════
|
|
||||||
# Для машинно-специфичных настроек
|
|
||||||
[[ -f "${ZSH_CONFIG_DIR}/local.zsh" ]] && source "${ZSH_CONFIG_DIR}/local.zsh"
|
[[ -f "${ZSH_CONFIG_DIR}/local.zsh" ]] && source "${ZSH_CONFIG_DIR}/local.zsh"
|
||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
|
[[ -f "${ZDOTDIR}/.p10k.zsh" ]] && source "${ZDOTDIR}/.p10k.zsh"
|
||||||
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
|
|
||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit /home/ada/.config/zsh/.p10k.zsh.
|
# ═══ Fastfetch ══════════════════════════════════════════════
|
||||||
[[ ! -f /home/ada/.config/zsh/.p10k.zsh ]] || source /home/ada/.config/zsh/.p10k.zsh
|
[[ -z "$TMUX" && "$TERM_PROGRAM" == "kitty" ]] && fastfetch
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export NVM_DIR="$HOME/.config/nvm"
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
||||||
|
|
||||||
|
|
||||||
# . "$HOME/.local/share/../bin/env"
|
|
||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit ~/.dotfiles/zsh/.config/zsh/.p10k.zsh.
|
|
||||||
[[ ! -f ~/.dotfiles/zsh/.config/zsh/.p10k.zsh ]] || source ~/.dotfiles/zsh/.config/zsh/.p10k.zsh
|
|
||||||
|
|||||||
Reference in New Issue
Block a user