安裝
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
配置
所有的配置都在~/.zshrc文件里面
nano ~/.zshrc
選擇自己喜歡的主題:
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
增加喜歡的插件:
#See https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
plugins=(
git #默認的,沒得說
sudo #按esc可以自動添加sudo
extract #x 文件名 就可以解壓了
z #目錄跳轉(zhuǎn)
)
第三方主題
powerlevel9k
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
配置文件~/.zshrc中修改ZSH_THEME:
#ZSH_THEME="robbyrussell" 這行注釋掉
ZSH_THEME="powerlevel9k/powerlevel9k"
powerlevel9k設(shè)置功能強大银舱,可以直接拷貝別人的配置文件
生效:
source ~/.zshrc
第三方插件
手動安裝自動補全插件
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
配置文件~/.zshrc中加上:
plugins=( [plugins...] zsh-autosuggestions)
生效:
source ~/.zshrc
語法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
配置文件~/.zshrc中加上:
plugins=( [plugins...] zsh-syntax-highlighting)
生效:
source ~/.zshrc
搜索魚插件
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
配置文件~/.zshrc中加上:
plugins=( [plugins...] history-substring-search)
生效:
source ~/.zshrc
命令簡寫提醒插件
git clone https://github.com/MichaelAquilina/zsh-you-should-use.git $ZSH_CUSTOM/plugins/you-should-use
配置文件~/.zshrc中加上:
plugins=( [plugins...] you-should-use)
生效:
source ~/.zshrc
自動補全插件
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
配置文件~/.zshrc中加上:
plugins=( [plugins...] zsh-completions)
生效:
source ~/.zshrc