新買了一臺服務(wù)器实檀,記錄下基礎(chǔ)配置項(xiàng)的過程略号,以便日后查詢。
1.安裝zsh包
yum -y install zsh
2.切換默認(rèn)shell為zsh
chsh -s /bin/zsh
3.重啟服務(wù)器讓修改的配置生效
這個沒什么好多說的,我習(xí)慣在web端控制臺直接重啟。
4.安裝on my zsh
curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
wget
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
實(shí)際上到這一步oh my zsh就已經(jīng)安裝完成了叁巨。
5.修改oh my zsh 主題
查看oh my zsh主題
ls ~/.oh-my-zsh/themes
顯示如下
adben.zsh-theme gallois.zsh-theme nicoulaj.zsh-theme
af-magic.zsh-theme garyblessington.zsh-theme norm.zsh-theme
afowler.zsh-theme gentoo.zsh-theme obraun.zsh-theme
agnoster.zsh-theme geoffgarside.zsh-theme peepcode.zsh-theme
alanpeabody.zsh-theme gianu.zsh-theme philips.zsh-theme
amuse.zsh-theme gnzh.zsh-theme pmcgee.zsh-theme
apple.zsh-theme gozilla.zsh-theme pure.zsh-theme
arrow.zsh-theme half-life.zsh-theme pygmalion.zsh-theme
修改主題
vim ~/.zshrc
可以看到默認(rèn)的主題是ZSH_THEME="robbyrussell"
改成自己喜歡的即可
oh my zsh是一個非常好用的工具,雖然我更多只是用到它的命令補(bǔ)全功能呐籽,想了解更多關(guān)于oh my zsh的內(nèi)容請查看它的文檔
補(bǔ)充
最近重裝oh-my-zsh
發(fā)現(xiàn)會報(bào)錯:正在連接 raw.githubusercontent.com (raw.githubusercontent.com)|::|:443... 失敺嫔住:拒絕連接。
此時狡蝶,可以采用以下方法安裝:
- 先用 git 下載
oh-my-zsh
項(xiàng)目到本地:git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
- 將 zshrc 替換掉:
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
- 重啟終端即可看到安裝成功