Skip to content

MacOS 配置

Add this alias to your shell configuration to see your top 10 most used commands:

Terminal window
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"
Terminal window
# Install Zsh via Homebrew
brew install zsh
# Install Oh My Zsh
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Syntax Highlighting

Terminal window
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git

Powerlevel10k Theme

Terminal window
cd ~/.oh-my-zsh/custom/themes
git clone https://github.com/romkatv/powerlevel10k.git

Add the theme to your ~/.zshrc:

Terminal window
echo "ZSH_THEME=powerlevel10k/powerlevel10k" >> ~/.zshrc

Run the configuration wizard:

Terminal window
p10k configure