上回书说到vscode连接liunx,默认 CentOS / Ubuntu / Mac 系统用的是 Bash
有点丑,而且使用体验也不是很好,我们使用on-my-zsh改造一下
- 安装
zsh
sudo yum install -y zsh
- 安装
oh-my-zsh
1.这是一个github开源项目,所以先装个git,当然有的服务器可能自带git
sudo yum install -y git
2.安装oh-my-zsh(任选其一)
curl安装
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
wget安装
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
3.设置主题
vim ~/.zshrc
这一行就是主题,可以去 这里看看自己想要的
4.安装插件
进入插件目录
cd /root/.oh-my-zsh/plugins 安装高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
安装自动补全
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
配置一下
~/.zshrc 中找到plugin
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
最后生效一下
source ~/.zshrc