Skip to content

Commit 8fbbfad

Browse files
committed
docs: 添加README文档介绍跨平台终端配置仓库
添加详细的README文档,说明仓库的目录结构、功能特性、安装步骤和使用方法。文档包含Windows和Linux/macOS平台的配置说明,以及常用别名和更新方法。
1 parent fa609d4 commit 8fbbfad

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# 🔧 Dotfiles
2+
3+
跨平台终端配置文件管理仓库 (Windows & Linux/macOS)。
4+
通过统一的配置和工具链,在不同系统间提供一致的终端体验。
5+
6+
## 📂 目录结构
7+
8+
```text
9+
dotfiles/
10+
├── powershell/ # Windows PowerShell 配置与安装脚本
11+
├── zsh/ # Linux/macOS Zsh 配置与安装脚本
12+
└── posh/ # Oh My Posh 主题配置 (全平台通用)
13+
```
14+
15+
## ✨ 功能特性
16+
17+
* **多平台统一**: 无论是在 Windows PowerShell 还是 Linux Zsh,享受一致的提示符和操作习惯。
18+
* **Oh My Posh**: 集成自定义主题 (`posh/theme.omp.json`),美观且实用。
19+
* **自动化安装**: 提供开箱即用的安装脚本,自动处理软链接 (Symlink) 和备份旧配置。
20+
* **常用别名**: 预设 `g` (git), `l` (ls) 等常用别名。
21+
* **环境隔离**: 配置文件通过软链接指向本仓库,方便通过 Git 进行版本控制和同步。
22+
23+
## 🚀 快速开始
24+
25+
### 前置要求
26+
27+
在安装配置之前,请确保已安装以下基础工具:
28+
29+
1. **Git**: 用于管理版本控制。
30+
2. **Oh My Posh**: 终端提示符引擎。
31+
* Windows: `winget install JanDeDobbeleer.OhMyPosh -s winget`
32+
* Linux/macOS: `curl -s https://ohmyposh.dev/install.sh | bash -s`
33+
3. **Nerd Fonts**: 为了正确显示图标,请安装并配置 Nerd Font,在脚本中会默认下载 Cascadia Code 字体。
34+
35+
### 📦 安装步骤
36+
37+
#### Windows (PowerShell)
38+
39+
在 PowerShell 中运行安装脚本:
40+
41+
```powershell
42+
# 进入仓库目录
43+
cd dotfiles
44+
45+
# 运行安装脚本
46+
.\powershell\install.ps1
47+
```
48+
49+
> **注意**: 脚本会自动将 `$PROFILE` 链接到仓库中的 `Microsoft.PowerShell_profile.ps1`,并备份原文件。如果遇到权限问题,请以管理员身份运行终端。
50+
51+
#### Linux / macOS (Zsh)
52+
53+
在终端中运行安装脚本:
54+
55+
```bash
56+
# 进入仓库目录
57+
cd dotfiles
58+
59+
# 赋予执行权限并运行
60+
chmod +x zsh/install.sh
61+
./zsh/install.sh
62+
```
63+
64+
> **注意**: 脚本会将 `~/.zshrc` 链接到仓库中的 `zsh/.zshrc`,并建立 `~/dotfiles` 的软链接以确保路径一致性。
65+
66+
### 常用别名 (Alias)
67+
68+
| 别名 | 原命令 | 说明 |
69+
| :--- | :--- | :--- |
70+
| `g` | `git` | Git 简写 |
71+
| `l` | `ls` (Windows) / `ls -lah` (Linux) | 列出文件 |
72+
| `dot` | `cd ~/dotfiles` | 快速跳转到配置仓库 |
73+
74+
## 🔄 更新配置
75+
76+
当你修改了仓库中的配置文件后:
77+
78+
* **PowerShell**: 重启终端或运行 `. $PROFILE`
79+
* **Zsh**: 重启终端或运行 `source ~/.zshrc`

0 commit comments

Comments
 (0)