Mac 终端配置 oh-my-zsh 和自动补全以及命令高亮

  1. 安装 oh-my-zsh
    在终端输入命令:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  1. 安装自动补全插件
    在终端输入命令:
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions.git
  1. 安装命令高亮插件
    在终端输入命令:
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
  1. 配置 .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)
  1. 让配置生效
 source ~/.zshrc
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容