MacOS 配置
1. Terminal Tips
Section titled “1. Terminal Tips”Analyze Command History
Section titled “Analyze Command History”Add this alias to your shell configuration to see your top 10 most used commands:
alias his="history | awk '{CMD[\$2]++;count++;}END{for (a in CMD)print CMD[a]\" \"CMD[a]/count*100\"% \"a;}' | grep -v \"./\" | column -c3 -s \" \" -t | sort -nr | nl | head -n10"2. Zsh Configuration
Section titled “2. Zsh Configuration”Install Zsh & Oh My Zsh
Section titled “Install Zsh & Oh My Zsh”# Install Zsh via Homebrewbrew install zsh
# Install Oh My Zshsh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"Install Plugins & Themes
Section titled “Install Plugins & Themes”Syntax Highlighting
cd ~/.oh-my-zsh/custom/pluginsgit clone https://github.com/zsh-users/zsh-syntax-highlighting.gitPowerlevel10k Theme
cd ~/.oh-my-zsh/custom/themesgit clone https://github.com/romkatv/powerlevel10k.gitConfigure Zsh
Section titled “Configure Zsh”Add the theme to your ~/.zshrc:
echo "ZSH_THEME=powerlevel10k/powerlevel10k" >> ~/.zshrcRun the configuration wizard:
p10k configure