ubuntu安装zsh

zsh

安装

1
sudo apt install zsh

切换zsh

1
chsh -s /bin/zsh

查看

1
echo $SHELL

oh-my-zsh

安装

1
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh

配置zsh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
## 拷贝一个模板配置
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

## 下载两个插件试试
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/plugins/zsh-autosuggestions

## 添加到~/.zshrc 中
plugins=(git
zsh-autosuggestions
zsh-syntax-highlighting
)

使之生效

1
source ~/.zshrc