item2和zsh配置

iTerm2安装与配置

安装iTerm2

iTerm2官网:https://www.iterm2.com/

Solarized主题配置

iTerm2支持许多的主题配色,可以自己定义,也可以参考网上现成的主题配色。我个人比较喜欢Solarized配色,因为可以配合Vim里面的Solarized主题。

1
2
3
4
5
6
7
8
9
10
11
# git下Solarized 的源码
git clone git://github.com/altercation/solarized.git
cd solarized/vim-colors-solarized/colors

sudo mkdir -p ~/.vim/colors
sudo cp solarized.vim ~/.vim/colors/

# 把下面这三行复制到~/.vimrc
syntax enable
set background=dark
colorscheme solarized

要使ITerm2和vim的显示效果保持一致,还需要最后一步设置:Preferences -> Profiles ->Text中取消Draw bold text in bright color的勾选。

Powerline字体

1
2
3
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh #安装所有Powerline字体

然后到 iterm2 配置,设置字体为Roboto Mono for Powerline

zsh安装与配置

安装zsh

1
2
3
4
5
cat /etc/shells				#查看系统内置的shell
sudo brew install zsh #安装zsh
chsh -s /bin/zsh #将zsh配置为默认的shell
chsh -s /bin/bash #默认shell切换回bash
echo $SHELL #查看当前shell

安装oh-my-zsh

1
2
3
4
5
6
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.zshrc ~/.zshrc.bk
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

cd ~/.oh-my-zsh/tools
./install.sh

主题配置

通过修改~/.zshrc中的环境变量ZSH_THEME可以进行zsh主题配置

查看主题:https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

1
2
ZSH_THEME="agnoster"      
ZSH_THEME="random" #主题随机变化
0%