Compare commits

..

3 Commits

Author SHA1 Message Date
imbytecat 77d51c65b3 feat(zsh): 现代化 zshrc 配置并删除冗余 vim
zshrc 配置更新:
- 新增 EDITOR/VISUAL/MANPAGER/PAGER 环境变量,让 git commit、
  visudo、man 等工具默认使用 nvim 与 bat
- zoxide init --cmd cd 直接接管 cd,删除手动 alias cd=z/cdi=zi
- 新增 yazi yy wrapper:退出时自动 cd 到最后浏览的目录
- FZF 默认配置:fd 联动 + 现代 UI(高度/边框/预览窗口)
- compinit 缓存优化:每天重建一次 zcompdump,平时复用
- eza alias 公共参数提取到 _EZA_BASE,所有列表都带 --git
- 新增 Ctrl+Space 接受 zsh-autosuggestions 建议

base.py 同步:
- 删除冗余 vim:neovim 已装且 EDITOR=nvim 已设置,
  visudo 等工具会通过 $EDITOR fallback 到 nvim
2026-04-08 13:21:59 +08:00
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
imbytecat d4cb2f8acb refactor(base): 用 ouch 替换 atool 与冗余解压器
atool 上次更新于 2016 年,且依赖外部 unzip/unrar/p7zip 二进制。
ouch 是纯 Rust 实现,所有常见格式(zip/7z/rar/tar/gz/bz2/xz/zst 等)
通过 Rust crates 原生支持,运行时零外部依赖。

- pacman: -atool -unrar -unzip +ouch
- 保留 7zip:yazi 用作存档预览/提取的可选依赖
- .zshrc: alias x: aunpack → ouch decompress
2026-04-08 13:20:55 +08:00
2 changed files with 43 additions and 16 deletions
+41 -11
View File
@@ -1,13 +1,25 @@
# ── PATH ── # ── PATH ──
export PATH="$HOME/go/bin:$HOME/.bun/bin:$PATH" export PATH="$HOME/go/bin:$HOME/.bun/bin:$PATH"
# ── 默认编辑器与分页器 ──
export EDITOR=nvim
export VISUAL=nvim
export PAGER=less
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# ── Shell 选项 ── # ── Shell 选项 ──
setopt AUTO_CD # 输目录名直接 cd setopt AUTO_CD # 输目录名直接 cd
setopt INTERACTIVE_COMMENTS # 允许交互式 # 注释 setopt INTERACTIVE_COMMENTS # 允许交互式 # 注释
setopt NO_BEEP # 关蜂鸣 setopt NO_BEEP # 关蜂鸣
# ── 补全系统(必须在 fzf-tab 之前)── # ── 补全系统(必须在 fzf-tab 之前)──
autoload -Uz compinit && compinit # 每天重建一次 zcompdump,其余启动直接复用,节省启动时间
autoload -Uz compinit
if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then
compinit
else
compinit -C
fi
# ── 外部插件 ── # ── 外部插件 ──
source /usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh source /usr/share/zsh/plugins/fzf-tab-git/fzf-tab.plugin.zsh
@@ -23,9 +35,18 @@ sudo-command-line() {
zle -N sudo-command-line zle -N sudo-command-line
bindkey '\e\e' sudo-command-line bindkey '\e\e' sudo-command-line
# ── Ctrl+Space 接受自动建议 ──
bindkey '^ ' autosuggest-accept
# ── FZF 默认行为(fd 联动 + 现代 UI)──
export FZF_DEFAULT_OPTS='--height=50% --layout=reverse --border --preview-window=right:60%'
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'
# ── 工具初始化(顺序重要)── # ── 工具初始化(顺序重要)──
eval "$(starship init zsh)" eval "$(starship init zsh)"
eval "$(zoxide init zsh)" eval "$(zoxide init --cmd cd zsh)" # cd 直接被 zoxide 接管,cdi 自动可用
eval "$(mise activate zsh)" eval "$(mise activate zsh)"
eval "$(direnv hook zsh)" eval "$(direnv hook zsh)"
eval "$(fzf --zsh)" # Ctrl+T 搜文件, Alt+C 搜目录 eval "$(fzf --zsh)" # Ctrl+T 搜文件, Alt+C 搜目录
@@ -33,27 +54,36 @@ eval "$(atuin init zsh)" # 必须在 fzf 之后,接管 Ctrl+R
# ── 别名 ── # ── 别名 ──
# 导航 # 导航
alias cd="z"
alias cdi="zi"
alias ..="cd .." alias ..="cd .."
alias ...="cd ../.." alias ...="cd ../.."
# 文件列表 # 文件列表(公共参数提取,DRY
alias ls="eza --icons --group-directories-first" _EZA_BASE=(--icons --group-directories-first --git)
alias ll="eza -la --icons --git --group-directories-first" alias ls="eza ${_EZA_BASE}"
alias la="eza -a --icons --group-directories-first" alias ll="eza -la ${_EZA_BASE}"
alias lt="eza --tree --level=2 --icons" alias la="eza -a ${_EZA_BASE}"
alias lt="eza --tree --level=2 ${_EZA_BASE}"
# 工具 # 工具
alias cat="bat --paging=never" alias cat="bat --paging=never"
alias rm="trash-put" alias rm="gomi"
alias lg="lazygit" alias lg="lazygit"
alias vi="nvim" alias vi="nvim"
alias x="aunpack" # 万能解压(支持 tar/zip/7z/rar alias x="ouch decompress" # 万能解压(zip/tar/gz/bz2/xz/zst/7z/rar
# 网络 # 网络
alias http="xh" alias http="xh"
# ── yazi wrapper:退出时自动 cd 到最后目录 ──
function yy() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
yazi "$@" --cwd-file="$tmp"
if cwd="$(command cat -- "$tmp")" && [[ -n "$cwd" && "$cwd" != "$PWD" ]]; then
builtin cd -- "$cwd"
fi
command rm -f -- "$tmp"
}
# ── WSL 剪贴板 ── # ── WSL 剪贴板 ──
if [[ -n "$WSL_DISTRO_NAME" ]]; then if [[ -n "$WSL_DISTRO_NAME" ]]; then
alias pbcopy="clip.exe" alias pbcopy="clip.exe"
+2 -5
View File
@@ -34,7 +34,6 @@ class BaseModule(Module):
def pacman_packages(self) -> set[str]: def pacman_packages(self) -> set[str]:
return { return {
"7zip", "7zip",
"atool",
"atuin", "atuin",
"base-devel", "base-devel",
"base", "base",
@@ -51,16 +50,13 @@ class BaseModule(Module):
"git", "git",
"jq", "jq",
"micro", "micro",
"ouch",
"procs", "procs",
"ripgrep", "ripgrep",
"sd", "sd",
"starship", "starship",
"sudo", "sudo",
"tealdeer", "tealdeer",
"trash-cli",
"unrar",
"unzip",
"vim",
"wget", "wget",
"xh", "xh",
"yazi", "yazi",
@@ -72,4 +68,5 @@ class BaseModule(Module):
def aur_packages(self) -> set[str]: def aur_packages(self) -> set[str]:
return { return {
"decman", "decman",
"gomi-bin",
} }