iTerm2 配置
安装
使用 homebrew 进行安装
brew cask install iterm2
主题
安装
配置
- Preferences -> Profiles -> Colors -> Color Presets
Oh My Zsh
安装
Install with curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install with wget
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
主题
安装 Powerlevel10k
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
修改
- 输入
vim ~/.zshrc
- 按
i
进入编辑 - 找到
ZSH_THEME="robbyrussell"
这一行 - 修改为
ZSH_THEME="agnoster"
或者ZSH_THEME="powerlevel10k/powerlevel10k"
- 保存退出
esc + :wq
- 输入
source ~/.zshrc
重启
字体
- 安装 hack-nerd-font 字体(字体网站)
brew tap homebrew/cask-fonts
brew cask install font-hack-nerd-font - 安装 PowerLine 字体(解决乱码)
cd ~/Downloads
git clone https://github.com/powerline/fonts.git
cd fonts
bash install.sh - 配置(选择 For PowerLine 的字体)
- Preferences -> Profiles -> Text -> Change Font
插件
语法高亮插件 zsh-syntax-highlighting
运行
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
vim ~/.zshrci
进入编辑plugins 配置,增加
zsh-syntax-highlighting
运行
source ~/.zshrc
自动填充插件 zsh-autosuggestions
运行
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
vim ~/.zshrci
进入编辑plugins 配置,增加
zsh-autosuggestions
运行
source ~/.zshrc
常见问题
权限问题
运行
chmod 755 /usr/local/share/zsh
chmod 755 /usr/local/share/zsh/site-functionszsh: command not found: xxx
- 输入
vim ~/.zshrc
- 按
i
进入编辑 - 找到
# User configuration
这行 - 在下方添加
source ~/.bash_profile
- 保存退出
esc + :wq
- 输入
source ~/.zshrc
重启
- 输入
Auto suggestions No show
If the auto suggestions do not appear to show, it could be a problem with your color scheme. Under "iTerm → Preferences → Profiles → Colors tab", check the value of Black Bright, that is the color your auto suggestions will have. It will be displayed on top of the Background color. If there is not enough contrast between the two, you won't see the suggestions even if they're actually there..