Mac上配置iTerm2 -让命令更加丰富工作更高效

1. 安装iTerm2

iTerm2 是一款完全免费的,专为 Mac OS 用户打造的命令行应用。直接在官网上http://iterm2.com/ 下载并安装即可。

也可以通过Homebrew来安装:

$ brew cask install iterm2

2. 配置 Oh My Zsh

(1)设置ITerm为默认终端

$  chsh -s /bin/zsh // 一般需要输入电脑开机密码

(2)Oh My Zsh 是对主题的进一步扩展,地址:https://github.com/robbyrusse...

使用curl安装:

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

3. 配置配色

我用到了pip工具,没有的话可以这样安装

$  sudo easy_install pip

(1)安装powerline

$ pip install powerline-status --user

(2)下载字体和配色

$ mkdir ~/Desktop/OpenSource/
$ cd ~/Desktop/OpenSource/
$ git clone [https://github.com/powerline/fonts.git](https://github.com/powerline/fonts.git) --depth=1
$ cd fonts
$ ./install.sh

$ cd ~/Desktop/OpenSource
$ git clone [https://github.com/altercation/solarized](https://github.com/altercation/solarized)
$ cd solarized/iterm2-colors-solarized/
$ open .

在打开的finder窗口中,双击Solarized Dark.itermcolors和Solarized Light.itermcolors即可安装明暗两种配色。

4. 安装主题

$ cd ~/Desktop/OpenSource/
$ git clone [https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git](https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git)
$ cd oh-my-zsh-agnoster-fcamblor/
$ ./install
$ vi ~/.zshrc 

vim 编辑文件 修改主题

ZSH_THEME="agnoster"

执行下面命令

$ source ~/.zshrc 

重启iTem就好了。

5. 修改字体

按照上面配置好后,发现提示符并不是好看的箭头,而是小问号,这个时候,检查一下字体配置。

iterm2->Preference->Profile->Text->Non-ASCII Font

这个里面,应该选择“……for powerline”之类的字体,可以看到终端的提示符立刻变美了~

参考资料:Mac/Linux下配置iTerm2+zsh+powerline美化终端窗口[https://www.xiebruce.top/590.html]

你可能感兴趣的:(Mac上配置iTerm2 -让命令更加丰富工作更高效)