先來看一下效果, 容許我用一下官方圖片node
zsh是Z Shell, 功能很強大可是太複雜,因此就出現了優化版的oh-my-zshgit
zsh --version;
若是存在, 則說明已安裝, 直接跳過本步驟 (mac 自帶Z Shell)github
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
若是遇到問題, 能夠直接copy上面的sh文件, 而後download, 本地執行sh命令npm
更強大的終端工具, 替換系統terminal, 與oh-my-zsh配合起來使用更完美
具體功能能夠訪問iterm2官網bash
爲了不有些oh-my-zsh主題的字體亂碼問題, 最好設置iterm2的font爲powerline類的字體, 本身search一下
字體傳送門, 按README進行下載安裝.
Paste_Image.pngcurl
修改 ~/.zshrc 下的 ZSH_THEME 字段, 如ZSH_THEME="agnoster"
, 流行主題之一. 主題庫傳送門.工具
插件安裝, 目錄到入~/.oh-my-zsh/plugins字體
# zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions # zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
修改 ~/.zshrc 下的plugins字段, 如優化
plugins=(git homebrew node npm zsh-autosuggestions zsh-syntax-highlighting)
更多插件去google搜插件名安裝google
zsh安裝後, .bash_profile下設置的環境變量和alias會失效, 須要在~/.zshrc文件裏添加以下:
source .bash_profile
chsh -s /bin/zsh
切回bash能夠用
chsh -s /bin/bash