1、 說(shuō)明
linux與mac ox系統(tǒng),shell類(lèi)型默認(rèn)都是bash, 在使用時(shí)候預(yù)發(fā)提示,頁(yè)面美觀等都不夠強(qiáng)大,后來(lái)誕生了zsh,但zsh配置復(fù)雜,就有人在zsh基礎(chǔ)開(kāi)發(fā)出了 oh-my-zsh
下載地址: https://ohmyz.sh/#install
2、安裝
官網(wǎng)安裝方式:

image.png
終端執(zhí)行如下命令:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
執(zhí)行過(guò)程遇到443問(wèn)題。
HQITI0010:.ssh shiyang.long$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
原因是使用了國(guó)外資源,改國(guó)內(nèi)鏡像安裝
sh -c "$(curl -fsSL https://gitee.com/shmhlsy/oh-my-zsh-install.sh/raw/master/install.sh)"
安裝完成界面如下:

image.png
3、配置
(1)主題配置
-
oh-my-zsh相關(guān)配置再~/.zshrc下。vim ~/.zshrc
編輯 ~/.zshrc中的 ZSH_THEME="xxx"即可。默認(rèn) :ZSH_THEME="robbyrussell"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
更多主題查看github上的wiki:https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
-
修改完成,執(zhí)行配置文件生效即可
source ~/.zshrc
(2)插件配置
oh-my-zsh 自帶插件都儲(chǔ)存在 ~/.oh-my-zsh/plugins 目錄中。
4、安裝oh-my-zsh環(huán)境變量失效
【現(xiàn)象】:已經(jīng)安裝了maven , 在安裝oh-my-zsh后,發(fā)現(xiàn)mvn命令提示:command not found: mvn
【原因】:~/.bash_profile文件不再執(zhí)行
【方法】:將source ~/.bash_profile添加到 ~/.zshrc 即可。

image.png