Mac上配置iTerm2 -讓命令更加豐富工作更高效

1. 安裝iTerm2

iTerm2 是一款完全免費(fèi)的,專為 Mac OS 用戶打造的命令行應(yīng)用。直接在官網(wǎng)上http://iterm2.com/ 下載并安裝即可。

也可以通過Homebrew來安裝:

$ brew cask install iterm2

2. 配置 Oh My Zsh

(1)設(shè)置ITerm為默認(rèn)終端

$  chsh -s /bin/zsh // 一般需要輸入電腦開機(jī)密碼

(2)Oh My Zsh 是對主題的進(jìn)一步擴(kuò)展,地址: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"

執(zhí)行下面命令

$ source ~/.zshrc 

重啟iTem就好了。

5. 修改字體

按照上面配置好后,發(fā)現(xiàn)提示符并不是好看的箭頭,而是小問號,這個時候,檢查一下字體配置。

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

這個里面,應(yīng)該選擇“……for powerline”之類的字體,可以看到終端的提示符立刻變美了~

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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容