安装
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 #目录跳转
)
第三方主题
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设置功能强大,可以直接拷贝别人的配置文件
生效:
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