安装zsh
apt install zsh -y
查看系统中自带的shell
cat /etc/shells
切换shell
chsh -s /bin/zsh
安装 oh-my-zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh
bash ./install.sh
配置 oh-my-zsh
- 设置主题
vim ~/.zshrc
# 编辑ZSH_THEME配置
ZSH_THEME="agnoster"
# 重启zsh,使配置生效
source ~/.zshrc
- 设置自动补全
# 安装自动补全
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
vim ~/.zshrc
# 添加自动补全配置
plugins=(zsh-autosuggestions)
# 重启,使配置生效
source ~/.zshrc
- 高亮
# 安装高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
vim ~/.zshrc
# 添加高亮配置
plugins=(zsh-syntax-highlighting)
# 重启,使配置生效
source ~/.zshrc