1. oh-my-zsh安裝
1.1. 使用curl方式安裝
1.1.1 官方鏡像源
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
1.1.2 國內(nèi)Gitee加速源
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"
1.2. 使用wget方式安裝
1.2.1 官方鏡像源
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
1.2.2 國內(nèi)Gitee加速源
sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)"
2. Oh-my-zsh配置
2.1 主題配置
- Oh-my-zsh路徑為 ~/.oh-my-zsh/themes目錄內(nèi),我比較喜歡robbyrussell
# 可在主題目錄內(nèi)查找自己喜歡的主題
ls ~/.oh-my-zsh/themes/
- 修改~/.zshrc文件,將主題修改為robbyrussell
? ~ cat ~/.zshrc | grep ZSH_THEME
ZSH_THEME="robbyrussell"
# Setting this variable when ZSH_THEME=random will cause zsh to load
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
? ~
- 如果你喜歡挑戰(zhàn),想嘗試使用不同主題,可以考慮將主題設(shè)置成隨機模式
ZSH_THEME="random"
2.2 插件配置
2.1 下載插件
2.1.1 自動補全插件
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
2.1.2 語法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
2.2 引入插件
- 引入插件需要編輯~/.zshrc文件,在配置文件中找到plugins文件行,在其中添加內(nèi)容,如下是修改完成后的配置
? ~ cat ~/.zshrc | grep plugins=
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
? ~
文章來源地址http://www.zghlxwxcb.cn/news/detail-801483.html
文章來源:http://www.zghlxwxcb.cn/news/detail-801483.html
到了這里,關(guān)于MacOS安裝oh-my-zsh的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!