A collection of dotfiles to help you quickly set up a familiar development environment on a new machine.
- Automatic installation and configuration of Oh My Zsh and its plugins
- Vim/Neovim editor configuration
- Git configuration
- Terminal tools setup (kitty, yazi, etc.)
- Automatic installation of common software (via Homebrew)
- Window management tools configuration (Hammerspoon, Karabiner)
# Clone the repository
git clone https://github.com/allendred/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# Run the installation script
./scripts/installAll configuration files are located in the config/ directory.
config/zsh/zshrc: Zsh configurationconfig/vim/vimrc: Vim configurationconfig/git/gitconfig: Git configurationconfig/nvim/: Neovim configurationconfig/hammerspoon/: Hammerspoon configurationconfig/karabiner/: Karabiner configuration
This repository includes scripts for installing and managing Homebrew packages, located under config/brew/.
config/brew/0.install.sh- Script to install Homebrewconfig/brew/1.brewInstallApps.sh- Script to install applications from configuration filesconfig/brew/brew-both.txt- List of packages to install on all systemsconfig/brew/brew-mac.txt- List of packages to install only on macOSconfig/brew/brew-linux.txt- List of packages to install only on Linux
Serial installation (default):
./config/brew/1.brewInstallApps.shParallel installation (faster but may have more errors):
./config/brew/1.brewInstallApps.sh --parallel- Host-specific configurations can be added to the
config/zsh/hosts/directory - Aliases can be defined in
config/zsh/aliases.sh
cd ~/.dotfiles
./scripts/update.shThis repository incorporates several best practices to enhance security, robustness, and maintainability.
- Modular
zshConfiguration: The main~/.zshrcacts as a simple loader for modules located inconfig/zsh/modules/. This keeps the configuration clean and easy to manage. - Secrets Management: A mechanism for managing sensitive information (like API keys and tokens) is in place. Local secrets should be stored in the
~/.local_secretsfile, which is automatically loaded on shell startup but is ignored by Git. You can start by copying the provided.local_secrets.examplefile. - Script Linting: All key shell scripts have been analyzed and improved using
shellcheckto prevent common errors and enhance reliability.
这是一个用于管理各种配置文件的dotfiles仓库,帮助你在新环境中快速设置熟悉的开发环境。
- 自动安装和配置Oh My Zsh及其插件
- 配置Vim/Neovim编辑器
- 设置Git配置
- 配置终端工具(kitty, yazi等)
- 自动安装常用软件(通过Homebrew)
- 配置窗口管理工具(Hammerspoon, Karabiner)
# 克隆仓库
git clone https://github.com/allendred/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# 运行安装脚本
./scripts/install所有配置文件都位于 config/ 目录下。
config/zsh/zshrc: Zsh配置config/vim/vimrc: Vim配置config/git/gitconfig: Git配置config/nvim/: Neovim配置config/hammerspoon/: Hammerspoon配置config/karabiner/: Karabiner配置
本仓库包含用于安装和管理Homebrew包的脚本,位于 config/brew/ 目录下。
config/brew/0.install.sh- 安装Homebrew的脚本config/brew/1.brewInstallApps.sh- 从配置文件安装应用程序的脚本config/brew/brew-both.txt- 在所有系统上都要安装的包列表config/brew/brew-mac.txt- 仅在macOS上安装的包列表config/brew/brew-linux.txt- 仅在Linux上安装的包列表
串行安装(默认):
./config/brew/1.brewInstallApps.sh并行安装(更快但可能会有更多错误):
./config/brew/1.brewInstallApps.sh --parallel- 主机特定配置可以添加到
config/zsh/hosts/目录 - 别名可以在
config/zsh/aliases.sh中定义
cd ~/.dotfiles
./scripts/update.sh为了提高安全性、健壮性和可维护性,本仓库集成了一些最佳实践。
- 模块化的
zsh配置: 主配置~/.zshrc仅作为加载器,负责加载config/zsh/modules/目录下的各个模块。这让配置更清晰、易于管理。 - 敏感信息管理: 项目建立了一套敏感信息(如API密钥、Token等)的管理机制。私密信息应存放在
~/.local_secrets文件中,该文件会在启动时自动加载,但会被Git忽略以确保安全。您可以从复制.local_secrets.example文件开始使用。 - 脚本健壮性: 所有核心Shell脚本都经过了
shellcheck工具的分析和修复,以避免常见错误,提高脚本的可靠性。