- 查看當(dāng)前環(huán)境shell
echo $SHELL
- 查看系統(tǒng)自帶哪些shell
cat /etc/shells
- 如果沒(méi)有
/bin/zsh
的話郎逃,安裝zsh
yum install zsh # centos
brew install zsh # mac
- 將zsh設(shè)置為默認(rèn)的shell
chsh -s /bin/zsh
再次確認(rèn)下
echo $SHELL
看下當(dāng)前默認(rèn)shell有沒(méi)有改酷含,沒(méi)有的話要重啟終端。安裝oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
- 查看可用的主題
ls ~/.oh-my-zsh/themes
- 修改主題,編輯
~/.zshrc
ZSH_THEME="candy"
- 參考各種插件快捷鍵等
https://segmentfault.com/a/1190000013612471
- 安裝自動(dòng)補(bǔ)全插件
cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-autosuggestions
vi ~/.zshrc
加上插件補(bǔ)全命令只要輸入前幾個(gè)詞,按??按鍵就可以找歷史記錄
- 安裝自動(dòng)高亮插件
cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
vi ~/.zshrc
請(qǐng)務(wù)必保證插件順序,zsh-syntax-highlighting必須在最后一個(gè)敢靡。
然后在文件的最后一行添加:source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
總結(jié):人不裝逼會(huì)死
補(bǔ)充:oh-my-zsh主題支持conda虛擬環(huán)境