一、环境要求

  • A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL2 is preferred, but cygwin or msys also mostly work.
  • Zsh should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and newer). If not pre-installed (run zsh --version to confirm), check the following wiki instructions here: Installing ZSH
  • curl or wget should be installed
  • git should be installed (recommended v2.4.11 or higher)

参考资料:
https://github.com/ohmyzsh/ohmyzsh#prerequisites

二、安装 Zsh

执行命令 sudo apt install zsh

三、安装 OhMyZsh

四、安装 zsh-autosuggestions 插件

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

  1. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):

    1. plugins=(
    2. # other plugins...
    3. zsh-autosuggestions
    4. )
  2. Start a new terminal session.(执行命令 source ~/.zshrc

参考资料:

五、安装 autojump 插件

1、安装

新建一个autojump文件夹,进入其中,执行命令 git clone git://github.com/wting/autojump.git
在安装文件夹内,运行安装脚本并按照屏幕上的说明进行操作(要确保 ubuntu 已安装 python):

  1. cd autojump
  2. ./install.py or ./uninstall.py

可能遇到的问题:

2、添加插件

plugins=(... autojump),执行命令 source ~/.zshrc

用法:
j [path] 跳转到指定路径(有关键词模糊查询功能)
j --stat 查看现在 autojump 中的历史记录

参考资料:
https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/autojump

六、更换主题

~/.zshrc 中配置 ZSH_THEME="[想要的主题]",比如 ZSH_THEME="ys"
ZSH_THEME="" 即为不启用任何主题

配置完后,执行命令 source ~/.zshrc

参考资料:
https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

七、安装 zsh-syntax-highlighting 插件

八、参考博客

看官方文档永远是第一选择!