安装iTerm2

brew cask install iterm2

代码配色

选择iTerm2 -> Preferences -> Profiles -> Terminal 
终端颜色配置为 xterm-256color
下载 iTerm2-Color-Schemes 的配色合集

mkdir ~/.iterm2 && cd ~/.iterm2

git clone https://github.com/mbadolato/iTerm2-Color-Schemes

导入配色方案
选择schemes文件夹所有配色方案

安装字体图标

brew tap caskroom/fonts
brew cask install font-hack-nerd-font

安装成功后需要在 iTerm2 中配置一下,在 iTerm2 -> Preferences -> Profiles -> Text -> Font -> Change Font `栏位中,Text 下面勾选 Use a different font for non-ASCII text,然后在 Non-ASCII font 点击 Change font `修改

安装zsh

brew install zsh
# 默认的 shell 是 bash,需要修改为 zsh
sudo sh -c "echo $(which zsh) >> /etc/shells"
chsh -s $(which zsh)

安装oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

配置主题

主题目录:~/.oh-my-zsh/themes 
下载主题到主题目录

git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

修改主题配置 .zshr

ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE="nerdfont-complete"
# Customise the Powerlevel9k prompts
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh dir vcs newline status)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true

使配置修改生效

source ~/.zshrc

zsh插件

autojump

这个插件主要帮助我们记住目录,一键直达。
安装

brew install autojump
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
zsh-syntax-highlighting

zsh-syntax-highlighting 用于高亮你的 zsh 可用命令。

brew install zsh-syntax-highlighting
zsh-autosuggestions

自动提示插件

brew install zsh-autosuggestions
colors

colors 是一个 Ruby 实现的脚本,它可以配合 powerlevel9k 显示电脑上的文件图标(应该是通过后缀判断的)。

gem install colorls
Last modification:January 8, 2020
如果觉得我的文章对你有用,请随意赞赏