Feb-27, 2025 · 10min
change languageComprehensive guide to setting up a Mac development environment, including Homebrew installation, Oh My Zsh configuration, Powerlevel10k theme settings, VSCode configuration, Git and SSH settings, and more.
Ensure a good network environment
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"After installation, you will need to execute several commands to set environment variables, as prompted
Clone the repository
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zshCopy the template file
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrcReload the configuration
source ~/.zshrcClone the repository
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"Add to .zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"Reload the configuration
source ~/.zshrcInstall the font file that supports icons
Terminal settings use font

Custom configuration
p10k configureConfigure the data to be displayed
Configure the node version and package.json version to be displayed
vim ~/.p10k.zsh

Install zsh plugins
zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestionszsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingAdd to .zshrc
plugins=(
git
sudo
z
zsh-autosuggestions
zsh-syntax-highlighting
)Complete file .zshrc, the file name is .zshrc
Generate ssh keys
ssh-keygen -m PEM -t ed25519 -C "your.email@example.com"View ssh public key
cat ~/.ssh/id_ed25519.pubGlobal user name email
git config --global user.name "Your Name"
git config --global user.email "email@example.com"Current repository user name email
git config --local user.name "Your Name"
git config --local user.email "email@example.com"Configure quotepath option
Avoid Chinese path乱码
git config --global core.quotepath falseDo not ignore case
git config --global core.ignorecase falseComplete configuration .gitconfig
[user]
name = "Your Name"
email = "email@example.com"
[core]
quotepath = false
ignorecase = falseGenerate multiple ssh keys
ssh-keygen -m PEM -t ed25519 -C "your.email@example.com" -f ~/.ssh/id_ed25519ssh-keygen -m PEM -t ed25519 -C "your.email@example.com" -f ~/.ssh/id_ed25519_gitlabConfigure ssh configuration file
vim ~/.ssh/configComplete configuration .ssh/config
# Personal account, - the default config
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
# Work account-1
Host gitlab.com
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_ed25519_gitlab
IdentityFileis the ssh key configured for the current Host
ProxyCommandis the proxy configured for the GitHub repository, using thenccommand,127.0.0.1:7890is the local proxy port
Only when the desktop wallpaper is displayed when the front is scheduled

Adjust the size of the mouse pointer

Disable automatic capitalization

vim settings keyboard repeat

Global open keyboard long press continuous input
defaults write -g ApplePressAndHoldEnabled -bool false