1. 克隆 oh-my-zsh
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
2. 复制 .zshrc ,如果已有.zshrc,请手动复制此文件内容到.zshrc
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
3.切换到zsh
zsh
source ~/.zshrc
4. 下载该插件到 oh-my-zsh 的插件目录
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
5. 编辑 .zshrc 文件
vi ~/.zshrc
6. 找到 plugins=(git) 这一行,如果没有添加。更改为如下
plugins=(git zsh-autosuggestions)
7. 使配置文件立即生效
source ~/.zshrc
8. 将zsh设置为默认终端
chsh -s /bin/zsh
每次启动终端都提示以下权限问题
解决:
compaudit | xargs chmod g-w,o-w