This repository contains my personal dotfiles and automated installation scripts designed to provision a complete, highly-customized development environment on macOS from scratch.
To fully bootstrap the macOS environment, simply run the primary setup script. Ensure the scripts have the correct execution permissions before proceeding.
Before launching the setup scripts, ensure that your system is up to date and that the Xcode Command Line Tools are installed:
xcode-select --install# Grant execution permissions
chmod +x setup.sh homebrew-install.sh
# Run the complete setup
./setup.shWhat does setup.sh do?
- Zsh Core: Installs Oh My Zsh.
- Package Manager: Triggers
homebrew-install.shto install foundational CLI utilities. - Workspace Initialization: Provisions standard developer directories (
~/Code/projects,~/Code/forks, etc.). - Shell Customization: Installs necessary Zsh plugins (e.g.,
spaceship-prompt,zsh-autosuggestions,zsh-syntax-highlighting). - Configuration Linking: Backs up your existing
.zshrcand links the one provided in this repository. - Node.js Environment: Sets up
nvm, installs the latest LTS Node.js release, and installs essential global npm packages.
This repository includes a script homebrew-install.sh to automate the installation of Homebrew and various applications.
The script is controlled via command-line flags. Before running, ensure it has execution permissions:
chmod +x homebrew-install.shThen, run the script with the desired options:
./homebrew-install.sh [options]Options:
| Flag | Description |
|---|---|
-c, --cli |
Install command-line interface (CLI) tools. |
-g, --gui |
Install graphical user interface (GUI) applications (casks). |
-f, --fonts |
Install essential developer fonts (Nerd Fonts). |
-a, --mas |
Install Mac App Store apps (requires 'mas' CLI). |
-p, --proxy |
Enable proxy (http://127.0.0.1:7890) for the session. |
-m, --mirror |
Use Chinese mirror (USTC) for Homebrew for faster downloads. |
-h, --help |
Display the help message. |
Example:
To install CLI tools, GUI applications, and developer fonts using the Chinese mirror, run:
./homebrew-install.sh --cli --gui --fonts --mirrorNote: The script will check if Xcode Command Line Tools are installed. If not, it will prompt you to install them first by running xcode-select --install.
If you prefer to configure your environment manually instead of using the automated scripts, follow these instructions.
Run the following command to install Oh My Zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"After installation, update Oh My Zsh and reload your configuration:
omz update
source ~/.zshrcStarship is a fast and highly customizable prompt written in Rust. Install it using Homebrew:
brew install starshipAdd the following line to your .zshrc to initialize Starship:
eval "$(starship init zsh)"I use the following plugins to enhance the zsh experience:
- zsh-autosuggestions
- zsh-completions
- zsh-syntax-highlighting
Clone these plugins into your Oh My Zsh custom plugins directory:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingConfiguration Files
- View my
.zshrcconfiguration
- kirklin/dotfiles - My dotfiles
- kirklin/vscode-settings - My VS Code settings
- kirklin/eslint-config - My ESLint config
- kirklin/ts-starter - My starter template for TypeScript library
This README outlines the essential steps for setting up zsh, Oh My Zsh, and Starship, as well as installing useful plugins for an enhanced command-line experience.
Feel free to copy and use this markdown content directly!