插件安装

方法一

将当前目录切换到ohmyzsh的plugins文件夹

1
cd ~/.oh-my-zsh/custom/plugins
  1. 语法高亮 zsh-syntax-highlighting
    1
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
  2. 自动提示 zsh-autosuggestions
    1
    git clone https://github.com/zsh-users/zsh-autosuggestions

插件安装成功后需要在zsh的配置文件中将其激活,在终端执行以下命令以编辑zsh-shell的资源文件

1
vim ~/.zshrc

在里面找到并修改ZSH_THEME="ys"plugins=(git zsh-syntax-highlighting zsh-autosuggestions)

方法二

如果具有管理员权限,则可以使用apt安装插件

1
2
sudo apt install zsh-syntax-highlighting
sudo apt install zsh-autosuggestions

~/.zshrc文件末尾添加插件激活命令

1
2
. /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
. /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

安装 autojump

autojump用来快读跳转到某个文件夹

1
2
3
sudo yum install autojump       # yum in CentOS
or
sudo apt install autojump # apt in Ubuntu

~/.zshrc文件末尾加上. /usr/share/autojump/autojump.zsh以激活 autojump

终端异常

1
compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew_services

macos - zsh problem: compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew - Stack Overflow

Type brew cleanup in terminal to solve it.