Skip to content

Latest commit

 

History

History
97 lines (72 loc) · 3.62 KB

File metadata and controls

97 lines (72 loc) · 3.62 KB

🔧 Dotfiles

跨平台终端配置文件管理仓库 (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) 等常用别名。

🚀 快速开始

前置要求

在安装配置之前,请确保已安装以下基础工具:

  1. Git: 用于管理版本控制。
  2. Zsh: Linux/macOS 交互式 shell (安装脚本会自动通过 Brew 安装)。
  3. Nushell: Windows 交互式 shell。
  4. Starship: 终端提示符。
  5. Nerd Fonts: 为了正确显示图标,请安装并配置 Nerd Font。

📦 安装步骤

Windows (Nushell + Starship)

安装依赖(示例: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

Linux / macOS (Homebrew)

在终端中运行安装脚本:

# 进入仓库目录
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。

常用别名 (Alias)

别名 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

🧭 版本 2.0.0 迁移说明

  • Windows 终端方案统一为 WezTerm + Nushell + Starship。
  • 不再使用 Windows Terminal / PowerShell / Oh My Posh。
  • Linux 终端方案为 Ptyxis + Zsh + Starship(WezTerm 配置已于 2026-09 移除)。