Apple Silicon Mac 安装和配置 iTerm2

Screenshot from sindresorhus/pure

  • oh-my-zsh
  • zsh-autosuggestions 自动补全命令插件
  • zsh-syntax-highlighting 高亮插件
  • Pure 提示符插件
  • Snazzy 配色方案

iTerm2

> 查看项目地址

🌟 推荐使用 Homebrew 安装

1
brew install --cask iterm2

zsh

> Wikipedia

macOS 10.15 及以上系统预装 zsh

🌟 推荐使用 Homebrew 安装

1
brew install zsh

oh-my-zsh

> 查看项目地址

安装

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

配置

安装 oh-my-zsh 后,在 ~/.zshrc 中更改配置

自动补全 & 高亮插件

1
2
brew install zsh-autosuggestions
brew install zsh-syntax-highlighting

~/.zshrc 中增加以下内容

1
2
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh

提示符插件 Pure

> 查看项目地址

使用 Homebrew 安装
1
brew install pure

~/.zshrc 中增加以下内容

1
2
3
fpath+="/opt/homebrew/share/zsh/site-functions"
autoload -U promptinit; promptinit
prompt pure
使用 NPM 安装
1
npm install --global pure-prompt

~/.zshrc 中增加以下内容

1
2
3
fpath+="$HOME/.nvm/versions/node/<NODE_VERSION>/lib/node_modules/pure-prompt/functions"
autoload -U promptinit; promptinit
prompt pure

主题颜色 Snazzy

> 查看项目地址

下载 iterm2-snazzy 下的 Snazzy.itermcolors 配置文件,双击安装

沉浸式标题栏

找到 Appearance > General > Theme 选择 Minimal

附录:NVM 安装及配置

1
brew install nvm

~/.zshrc 中增加以下内容

1
2
3
4
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion

参考

作者

Plain

发布于

2021-11-07

更新于

2022-04-01

许可协议

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×