Ubuntu 安装 Oh My Zsh 插件配置

说明 Oh My ZSH 官网

Unleash your terminal like never before.
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout…

1.Oh My Zsh安装

1.1. 安装Zsh

# 安装 Zsh,遇到 Y/N 选择 Y
sudo apt install zsh
# 将 Zsh 设置为默认 Shell
# 可以通过 echo $SHELL 查看当前默认的 Shell,如果没有改为 /bin/zsh,那么需要重启 Shell。
chsh -s /bin/zsh

在这里插入图片描述

1.2. 安装 Oh My Zsh

  1. Install oh-my-zsh via curl
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. Install oh-my-zsh via wget
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
  1. 安装成功,配置文件在根目录下.zshrc,编辑vim ~/.zshrc
    Ubuntu 安装 Oh My Zsh 插件配置_第1张图片

2. Oh My Zsh 插件配置

2.1. zsh-autosuggestions

  1. 说明:命令行命令键入时的历史命令建议插件,自动补全。
  2. 安装:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  1. 配置:打开配置文件vim ~/.zshrc,找到plugins,在里面添加zsh-autosuggestions,重置source ~/.zshrc

2.2. zsh-syntax-highlighting

  1. 说明:命令行语法高亮插件
  2. 安装:
 git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  1. 配置:打开配置文件vim ~/.zshrc,找到plugins,在里面添加zsh-syntax-highlighting这个要放到最后),重置source ~/.zshrc

2.3. .zshrc文件整体修改

  1. 打开编辑.zshrc文件,找到plugins,进行修改:

Ubuntu 安装 Oh My Zsh 插件配置_第2张图片

  1. 保存、退出、重置
source ~/.zshrc

你可能感兴趣的:(Linux,ubuntu,linux,ubuntu)