zsh牛逼之處參見:https://www.zhihu.com/question/21418449
安裝zsh
yum install -y zsh
裝完之後驗證一下最後一行有/bin/zsh
[root@hadoop3 ~]# cat /etc/shells/bin/sh/bin/bash/sbin/nologin/usr/bin/sh/usr/bin/bash/usr/sbin/nologin/bin/zsh
切換shell為zsh
chsh -s /bin/zsh
然後echo $SHELL看還是bash,很多部落格說要重啟,其實只要退出終端重新開啟就切換過來了。
安裝oh-my-zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
有時候連不上github的443連接埠,就直接下載
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zshcp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
再重進登入一下終端就可以用了
查看主題
ls .oh-my-zsh/themes
把.zshrc裡面的theme改成ys,提示符變成這樣:
# root @ hadoop3 in ~ [10:59:27]
安裝自動提示外掛程式
wget http://mimosa-pudica.net/src/incr-0.2.zshmkdir ~/.oh-my-zsh/plugins/incrmv incr-0.2.zsh ~/.oh-my-zsh/plugins/increcho 'source ~/.oh-my-zsh/plugins/incr/incr*.zsh' >> ~/.zshrcsource ~/.zshrc
ok了,cd一下看看爽不爽。
安裝autojump
我yum源沒有autojump,直接下載安裝
git clone git://github.com/joelthelion/autojump.gitautojump/install.py
安裝完成在~/下面有.autojump目錄,在.zshrc裡面加一行
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
妥了,可以使用j了。
我敲過一遍cd ~/go/src/learningGo/ch2以後如果換了目前的目錄,再敲j 2就回來了,爽。