Files
archlinux-config/home/.zshrc
T
imbytecat 2b3544b4a5 refactor(base): 切换回收站工具 trash-cli → gomi-bin
trash-cli 是 Python 写的老牌方案,启动开销大且 5 年未发布正式
release。gomi 是 Go 实现的现代替代品:

- 完整兼容 freedesktop.org Trash 规范,与 yazi/GNOME/KDE 互通
- 提供交互式 TUI 浏览/恢复界面(gomi 无参数即进入)
- 性能比 trash-cli 快约 10 倍
- 极活跃维护,AUR 提供预编译 gomi-bin

回收站数据无缝迁移:两者都使用 ~/.local/share/Trash/。

- pacman: -trash-cli
- aur: +gomi-bin
- .zshrc: alias rm: trash-put → gomi
2026-04-08 13:21:16 +08:00

65 lines
1.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ── PATH ──
export PATH="$HOME/go/bin:$HOME/.bun/bin:$PATH"
# ── Shell 选项 ──
setopt AUTO_CD # 输目录名直接 cd
setopt INTERACTIVE_COMMENTS # 允许交互式 # 注释
setopt NO_BEEP # 关蜂鸣
# ── 补全系统(必须在 fzf-tab 之前)──
autoload -Uz compinit && compinit
# ── 外部插件 ──
source /usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # 必须最后
# ── 双击 ESC 自动加 sudo ──
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER"
zle end-of-line
}
zle -N sudo-command-line
bindkey '\e\e' sudo-command-line
# ── 工具初始化(顺序重要)──
eval "$(starship init zsh)"
eval "$(zoxide init zsh)"
eval "$(mise activate zsh)"
eval "$(direnv hook zsh)"
eval "$(fzf --zsh)" # Ctrl+T 搜文件, Alt+C 搜目录
eval "$(atuin init zsh)" # 必须在 fzf 之后,接管 Ctrl+R
# ── 别名 ──
# 导航
alias cd="z"
alias cdi="zi"
alias ..="cd .."
alias ...="cd ../.."
# 文件列表
alias ls="eza --icons --group-directories-first"
alias ll="eza -la --icons --git --group-directories-first"
alias la="eza -a --icons --group-directories-first"
alias lt="eza --tree --level=2 --icons"
# 工具
alias cat="bat --paging=never"
alias rm="gomi"
alias lg="lazygit"
alias vi="nvim"
alias x="ouch decompress" # 万能解压(zip/tar/gz/bz2/xz/zst/7z/rar
# 网络
alias http="xh"
# ── WSL 剪贴板 ──
if [[ -n "$WSL_DISTRO_NAME" ]]; then
alias pbcopy="clip.exe"
alias pbpaste="powershell.exe -noprofile -c Get-Clipboard"
fi
# ── Local ──
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local