- 安装zsh
sudo apt install zsh
- 设置默认终端
sudo chsh -s /bin/zsh ubuntu
- 安装oh-my-zsh
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
语法高亮插件
- 安装
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- 配置(可以忽略,后面直接替换生效)
在~/.zshrc的plugins中加入`zsh-syntax-highlighting
自动补全插件
- 防止报错
The unauthenticated git protocol on port 9418 is no longer supported.
,则解决如下:
git config --global url."https://".insteadOf git://
- 安装
git clone git://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- 替换主题并且使插件生效
sed -i "s/robbyrussell/ys/g" ~/.zshrc
sed -i "s/(git)/(git zsh-syntax-highlighting zsh-autosuggestions)/g" ~/.zshrc
source ~/.zshrc
- 配置(可以忽略,上面的sed直接替换生效)
在~/.zshrc的plugins 中加入zsh-autosuggestions