- 安装 Homebrew
- 安装 ZSH,安装成功可查看版本
zsh —version
- 配置终端默认使用 ZSH
chsh -s $(which zsh)
- 安装 iTerm2
brew cask install iterm2
- 配置 iTerm2 主题
- 下载 iTerm2-Color-Schemes,
iTerm → Preferences → Profiles → Colors → Color Presets... → Import → OceanicMaterial
iTerm → Preferences → Profiles → Keys → Load Preset... → Natural Text Editing
- 使用 Antigen 管理 ZSH 插件,
brew install antigen
编辑
~/.zshrc
,添加如下内容,执行source ~/.zshrc
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152# Antigen https://github.com/zsh-users/antigensource /usr/local/share/antigen/antigen.zshDEFAULT_USER=`id -un`# Load the oh-my-zsh's library.antigen use oh-my-zsh# Bundles from the default repo (robbyrussell's oh-my-zsh).antigen bundle autojumpantigen bundle awsantigen bundle dockerantigen bundle gitantigen bundle npmantigen bundle nvmantigen bundle osxantigen bundle react-native# zsh-nvm https://github.com/lukechilds/zsh-nvmNVM_LAZY_LOAD=trueNVM_AUTO_USE=trueantigen bundle lukechilds/zsh-nvm# Npm completionantigen bundle lukechilds/zsh-better-npm-completionantigen bundle akoenig/npm-run.plugin.zsh# Zsh completionantigen bundle zsh-users/zsh-completions# Auto suggestionsZSH_AUTOSUGGEST_USE_ASYNC=trueantigen bundle zsh-users/zsh-autosuggestions# Syntax highlighting bundle.antigen bundle zdharma/fast-syntax-highlighting# Automatic update antigen bundlesantigen bundle unixorn/autoupdate-antigen.zshplugin# Load the theme.# Powerlevel9k# https://github.com/bhilburn/powerlevel9k/wiki/Install-InstructionsPOWERLEVEL9K_INSTALLATION_PATH=$ANTIGEN_BUNDLES/bhilburn/powerlevel9kPOWERLEVEL9K_MODE='nerdfont-complete'POWERLEVEL9K_SHORTEN_DIR_LENGTH=2POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status nvm node_version)antigen theme bhilburn/powerlevel9k powerlevel9k# Tell Antigen that you're done.antigen apply配置 Powerlevel9k 主题
brew tap caskroom/fonts
brew cask install font-firacode-nerd-font
iTerm → Preferences → Profiles → Text → Change Font → Fura Code Nerd Font
,勾选Use ligatures
- 配置 VS Code 配置终端,首选项 → 设置 → 用户,在 setting.json 中添加12"terminal.integrated.shell.osx": "/bin/zsh","terminal.integrated.fontFamily": "'FuraCode Nerd Font'",