Linux下安装zsh和oh-my-zsh
系统:Debian 10.5 (阿里云)
工具:Xshell 6 (Build 0206)
1.Zsh的介绍
Zsh(Z-shell)是一款用于交互式使用的shell,也可以作为脚本解释器来使用。其包含了 bash,ksh,tcsh 等其他shell中许多优秀功能,也拥有诸多自身特色。
从 macOS Catalina 版开始,其默认shell从==bash====改为zsh。==
2.安装Zsh
sudo apt-get update======sudo apt-get install zsh========chsh -s /bin/zsh #====将====zsh====替换为你的默认====shell======

3.安装git(如有请忽略此步)
sudo apt-get install git====
4.安装oh-my-zsh
==默认的 Zsh 配置有点麻烦。因此一个叫 robbyrussel 的用户在 GitHub 上制作了一个配置文件 oh-my-zsh,这是目前为止最流行的 Zsh 配置:== https://github.com/ohmyzsh/ohmyzsh
安装教程在上面仓库的readme文件中有描述(这里以使用curl为例)
|
|
==方式== 命令
|**curl**|sh -c "$(curl -fsSL [https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh](https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh))"|
|**wget**|sh -c "$(wget -O- [https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh](https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh))"|
|**fetch**|sh -c "$(fetch -o - [https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh](https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh))"|

5.主题配置
下载完oh-my-zsh后的默认主题【robbyrussell】效果如上一步效果图
主题详细预览参考仓库中的wiki
https://github.com/robbyrussell/oh-my-zsh/wiki/themes
打开配置文件【~/.zshrc】,直接更改目标位置(esc后键入冒号输入/ZSH_THEME检索)的字符串即可

例如配置成【xiong-chiamiov-plus】
==ZSH_THEME="xiong-chiamiov-plus"======

6.插件配置
同样插件在仓库wiki也有描述
https://github.com/ohmyzsh/ohmyzsh/wiki/plugins
打开配置文件【~/.zshrc】,直接在目标位置(esc后键入冒号输入/plugins检索)的括号中添加即可

其实需要哪个插件就在~/.oh-my-zsh/custom/plugins/中克隆哪个仓库就行了
https://github.com/zsh-users
例如通过上方仓库添加代码高亮与自动补全
cd ~/.oh-my-zsh/custom/plugins/======git clone== ==https://github.com/zsh-users/zsh-autosuggestions.git== #==自动补全========git clone== ==https://github.com/zsh-users/zsh-syntax-highlighting.git== #==代码高亮======

然后将这两个插件添加到【~/.zshrc】中

补全和高亮成功设置

> 来自 <[https://www.cnblogs.com/illusory---/p/15066495.html](https://www.cnblogs.com/illusory---/p/15066495.html)>