跳到主要内容

oh-my-zsh代码提示和补全

· 阅读需 1 分钟

安装oh-my-zsh

  1. 安装
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. 编辑~/.zshrc
vim ~/.zshrc  # 或使用你喜欢的其他文本编辑器
  1. 主题配置
ZSH_THEME="robbyrussell"  # 默认主题
  1. 保存配置
source ~/.zshrc

使用 zsh-autosuggestions

  1. 下载
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  1. 打开~/.zshrc
plugins=(git zsh-autosuggestions)
  1. 保存
source ~/.zshrc

使用 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
  1. 打开~/.zshrc
plugins=( [plugins...] zsh-syntax-highlighting)