Mac配置oh my zsh,並使用ITerm2
先看看最終效果
-
第一步安裝on my zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
-
切換爲zsh
sudo chsh -s /bin/zsh
-
更換主題
在命令行用vim打開用戶根目錄下.zshrc,我的修改爲agnoster:
ZSH_THEME="agnoster"
-
安裝power-line字體
# clone git clone https://github.com/powerline/fonts.git --depth=1 # install cd fonts ./install.sh # clean-up a bit cd .. rm -rf fonts
-
設置字體高亮
brew install zsh-syntax-highlighting
打開zshrc配置文件追加
open ~/.zshrc
##關鍵字高亮 source $ZSH/oh-my-zsh.sh source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh #很多教程只有上邊那兩行,但是我們設置好編譯後發現關鍵字還是沒有高亮,這是因爲iTerm終端自身的原因,加上後面兩行代碼就可以將zsh中主題的顏色加載出來了 export CLICOLOR=1 export TERM=xterm-256color
-
下載ITeam2
自己去官網下載
-
更換顏色
打開ITerm2的設置頁面-Profiles-colors
選擇Solarized-Dark
-
更換字體
打開ITerm2的設置頁面-Profiles-Text
選擇Meslo Lg L for PowerLine
OVER