Skip to content

xm-tech/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

352 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Personal Dotfiles

overview

高度优化的 macOS 开发环境配置,专注于性能和模块化设计。

✨ 特性

  • 🚀 高性能: Vim 三级性能模式,Zsh 延迟加载,启动时间 <300ms
  • 🧩 模块化: Vim 7 模块配置,Zsh 功能分离
  • 🔧 自动化: Makefile 管理,一键安装/清理/备份
  • 🎨 开发友好: 40+ Git 别名,K8s 函数,fzf/z.lua 集成

📦 核心工具

  • 编辑器: Vim + coc.nvim (LSP)
  • Shell: Zsh + Zinit + Starship
  • 终端: Tmux + TPM
  • 版本控制: Git + icdiff + tig
  • 搜索: fzf + LeaderF + z.lua

🚀 快速开始

前提条件

macOS 系统(其他系统需手动安装依赖)

新机器安装

# 1. 克隆仓库
git clone https://github.com/xm-tech/dotfiles.git ~/dotfiles
cd ~/dotfiles

# 2. 安装 Homebrew 依赖(可选)
make bundle

# 3. 部署配置文件
make install

# 4. 配置私有信息(API keys 等)
cp .zsh_private.example ~/.zsh_private
vim ~/.zsh_private  # 填入你的私有配置

# 5. 重启终端或重新加载
source ~/.zshrc

旧机器迁移

# 导出当前 Homebrew 包列表
make bundle_dump

# 提交并推送到远程仓库
git add Brewfile
git commit -m "update: Brewfile"
git push

📖 使用指南

Vim 性能模式

快捷键 功能
<leader>tp 切换性能模式(Normal/Light/Heavy)
<leader>em 紧急模式(严重卡顿时)
:LightMode 启用轻量模式

特殊启动方式

lvim file.txt    # 轻量模式 Vim
pvim file.txt    # 无插件 Vim

Git 常用别名

gs      # git status -sb
gl      # 美化的 git log
gd      # git diff (使用 icdiff)
gc      # git checkout
gcb     # git checkout -b
gp      # git push
gpl     # git pull

Kubernetes 函数

kubeps [namespace]           # 查看 pods
kubelog <pod> <lines>        # 查看日志
kubelogin <namespace> <pod>  # 登录容器

🔧 Makefile 命令

make install              # 安装所有配置
make clean                # 清理符号链接和缓存
make clean all            # 完全重装
make bundle               # 安装 Homebrew 包
make bundle_dump          # 导出 Homebrew 包列表
make clean_zinit_cache    # 清理 Zinit 缓存
make help                 # 查看所有命令

📁 项目结构

dotfiles/
├── vimrc                 # Vim 主配置
├── vim/config/           # Vim 模块化配置
│   ├── basic.vim         # 基础设置
│   ├── performance.vim   # 性能优化
│   ├── plugins.vim       # 插件配置
│   ├── mappings.vim      # 快捷键
│   ├── filetypes.vim     # 文件类型
│   ├── statusline.vim    # 状态栏
│   └── logging.vim       # 日志
├── zshrc                 # Zsh 主配置
├── aliases.zsh           # 别名定义
├── funcs.zsh             # 函数定义
├── git.zsh               # Git 配置
├── proxy.zsh             # 代理管理
├── zinit-load.zsh        # Zinit 插件
├── tmux.conf             # Tmux 配置
├── coc-settings.json     # coc.nvim 配置
├── starship.toml         # 提示符配置
├── Makefile              # 自动化脚本
└── Brewfile              # Homebrew 包列表

🐛 故障排查

Vim 卡顿

  1. <leader>tp 切换到 Heavy 模式
  2. 使用 lvimpvim 启动
  3. 查看 AmazonQ.md 性能优化指南

Zsh 启动慢

# 清理 Zinit 缓存
make clean_zinit_cache
source ~/.zshrc

Git 别名不生效

# 清理缓存并重装
make clean all

📝 自定义配置

添加私有配置

编辑 ~/.zsh_private(不会被 git 追踪):

# 私有 API keys
export MY_API_KEY="xxx"

# 私有别名
alias myserver="ssh user@server"

修改 Vim 配置

编辑对应的模块文件:

  • 快捷键 → vim/config/mappings.vim
  • 插件 → vim/config/plugins.vim
  • 性能 → vim/config/performance.vim

📚 相关文档

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT License - 详见 LICENSE

About

My personal dotfiles inludes tmux, vim, zsh, git, tig ,etc. easy to install , easy to use

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors