Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout…
“Oh My ZSH!”
官网地址
安装
安装命令(二者均可):
1
| sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
1
| sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
|
环境变量失效?
将~/.bash_profile文件中的变量复制到~/.zshrc目录
macos下如果你之前用的是zsh 就将~/.zshrc.pre-oh-my-zsh文件中的变量复制到~/.zshrc目录即可
修改主题
1
2
3
4
5
6
7
| // ~/.zshrc
# 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"
|
插件
常用的两个插件
zsh-autosuggestions
自动建议补全
安装命令
1
| git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
zsh-syntax-highlighting
语法高亮插件
安装命令
1
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
安装好以后启用插件,也是在~/.zshrc中配置
1
2
3
4
5
6
7
| // ~/.zshrc
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)
|
刚安装好以后应该是只有一个git,后门两个是刚才下载的
z是自带插件,可以历史目录记录
配置好以后使用下面命令更新配置