/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

下載安裝.................
安裝成功
用裝好的 Homebrew安裝iterm2
輸入命令:brew cask instal iterm2
查看系統的shell
cat /etc/shells
回顯:
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
(bash是mac中terminal自帶的shell,把它換成zsh,這個的功能會增加)
更改默認shell:
chsh -s /bin/zsh
安裝oh-my-zsh:
github 地址:https://github.com/robbyrussell/oh-my-zsh
兩種安裝方式(注意要先安裝git,brew install git):
via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
via wget
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安裝成功
下載字體,在喜歡的位置新建一個文件夾,轉到新建的文件夾下
執行:
git clone https://github.com/powerline/fonts.git --depth=1
執行 ./install.sh
然后設置字體 :iTerm2 -> Preferences -> Profiles -> Text
安裝主題
git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git
執行目錄oh-my-zsh-agnoster-fcamblor下的 install文件:./install.sh
vim .zshrc
修改主題為 ZSH_THEME=
"agnoster"(設置
agnoster主題必須更換為meslo字體,不然會出現亂碼
)
可以更改個配色
退出重進iterm2風格如下:
可以安裝oh-my-zsh的插件
cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-autosuggestions.git(選擇自己想安裝的插件地址,去https://github.com/zsh-users查看)
vim ~/.zshrc
修改里面的 plugins=(git)
例如
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
source ~/.zshrc 搞定~