跨平台终端配置文件管理仓库 (Windows & Linux/macOS)。 Linux/macOS 默认终端组合为 Ptyxis + Zsh + Starship;Windows 为 WezTerm + Nushell + Starship。
dotfiles/
├── Brewfile # Homebrew 包清单 (brew bundle)
├── config/nushell/ # Nushell 配置
├── config/zsh/ # Linux/macOS Zsh 配置
├── config/bash/ # Bash 集成 (追加到 ~/.bashrc)
├── config/git/ # 共享 Git 配置 (delta pager)
├── config/nvim/ # Neovim (LazyVim)
├── config/yazi/ # Yazi 文件管理器
├── config/starship.toml # Starship 配置
├── config/glazewm/ # GlazeWM 配置 (Windows)
├── config/yasb/ # YASB 状态栏 (Windows)
└── config/dotfiles.env # 跨 shell 开关
- 统一终端栈: Linux 用 Zsh,Windows 用 Nushell,共享 Starship 提示符。
- 高可定制: Zsh/Nushell 语法与别名、Starship 提示符风格可组合调整。
- 环境隔离: 配置文件通过软链接指向本仓库,方便通过 Git 进行版本控制和同步。
- 常用别名: 预设
g(git),ll(ls) 等常用别名。
在安装配置之前,请确保已安装以下基础工具:
- Git: 用于管理版本控制。
- Zsh: Linux/macOS 交互式 shell (安装脚本会自动通过 Brew 安装)。
- Nushell: Windows 交互式 shell。
- Starship: 终端提示符。
- Nerd Fonts: 为了正确显示图标,请安装并配置 Nerd Font。
安装依赖(示例:winget):
winget install nushell.nushell
winget install Starship.Starship将配置链接到标准位置:
mkdir $env:USERPROFILE\.config -ea 0
New-Item -ItemType SymbolicLink -Path $env:USERPROFILE\.config\nushell -Target $PWD\config\nushell
New-Item -ItemType SymbolicLink -Path $env:USERPROFILE\.config\starship.toml -Target $PWD\config\starship.toml在终端中运行安装脚本:
# 进入仓库目录
cd dotfiles
# 赋予执行权限并运行
chmod +x install.sh
./install.sh注意: 脚本会自动检测并安装 Homebrew,然后运行
brew bundle安装 Brewfile 中声明的所有依赖 (Zsh, Nushell, Starship, Atuin, etc.) 并建立软链接。也可以单独执行brew bundle --file=~/dotfiles/Brewfile。
注意: 脚本会将
~/.zshrc链接到仓库中的config/zsh/.zshrc,将共享 Git 配置 include 到~/.gitconfig,并建立~/dotfiles的软链接以确保路径一致性。Linux 上还会把 zsh 注册到/etc/shells并设为登录 shell。
| 别名 | Windows (Nushell) | Linux/macOS (Zsh/Bash) | 说明 |
|---|---|---|---|
g |
git |
git |
Git 简写 |
ll |
ls (详细) |
lsd -la |
详细列表 |
la |
ls -Force |
lsd -a |
显示所有文件 (含隐藏) |
cat |
- | bat |
语法高亮查看 |
z |
zoxide |
zoxide |
智能目录跳转 |
dot |
cd $env.DOTFILES |
cd $DOTFILES |
快速跳转到配置仓库 |
当你修改了仓库中的配置文件后:
- Zsh: 重启终端或运行
source ~/.zshrc - Nushell: 重启终端或运行
source ~/.config/nushell/config.nu
- Windows 终端方案统一为 WezTerm + Nushell + Starship。
- 不再使用 Windows Terminal / PowerShell / Oh My Posh。
- Linux 终端方案为 Ptyxis + Zsh + Starship(WezTerm 配置已于 2026-09 移除)。