1. 安装
Method | Command |
---|---|
curl | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
wget | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
fetch | sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
2. 插件
打开~/.zshrc
文件找到plugins=( git )
,这里是我们已经启用的那些插件。
如果想要启用某个插件,装好之后直接修改
plugins = (插件A 插件B 插件C)
2.1. 自动补全zsh-autosuggestions
会记录你之前输入过的所有命令,并且自动匹配你可能想要输入命令,然后按→补全
安装
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
2.2. zsh-syntax-highlighting
这个插件直接在输入过程中就会提示你,当前命令是否正确,错误红色,正确绿色
安装
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
3. 主题
在官网的Themes中选择一个你喜欢的主题,在.zshrc中设置,例如
ZSH_THEME="avit"
参考文献
- https://github.com/ohmyzsh/ohmyzsh/wiki
- https://zhuanlan.zhihu.com/p/61447507
- https://ohmyz.sh/#install