Mac 终端配置 oh-my-zsh 和自动补全以及命令高亮
安装 oh-my-zsh
在终端输入命令:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安装自动补全插件
在终端输入命令:
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions.git
安装命令高亮插件
在终端输入命令:
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
配置 .zshrc 文件
在终端输入命令:
vim ~/.zshrc
在 ~/.zshrc 中添加以下内容:
source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
在 ~/.zshrc 中修改 plugins=(git) 为:
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
保存修改,让配置生效,在终端执行命令
source ~/.zshrc
配置主题
用命令ll ~/.oh-my-zsh/themes 查看目录下都有哪些主题,然后执行命令 vim ~/.zshrc,进入编辑配置, 修改ZSH_THEME即可指定zsh 样式
注:mac电脑git clone时要是报错,可以在前面加个sudo
|