1. 更新软件源
1
| sudo apt update && sudo apt upgrade -y
|
2. 安装 zsh
1
| sudo apt install zsh git -y
|
3. 设置默认终端为 zsh
注意:不要使用sudo
4. 安装 oh my zsh
1
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
5. 插件推荐
安装方式:把插件下载到本地的 ~/.oh-my-zsh/custom/plugins 目录。
- 命令提示插件
zsh -autosuggestions
1
| git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
- 命令语法校验插件
zsh-syntax-highlighting
1
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
启用插件
修改~/.zshrc中插件列表为
1
| plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract)
|
开启新的 Shell 或执行 source ~/.zshrc,就可以开始体验插件。
配置主题(可选)
1
| sudo wget -O $ZSH_CUSTOM/themes/haoomz.zsh-theme https://cdn.haoyep.com/gh/leegical/Blog_img/zsh/haoomz.zsh-theme
|
编辑 ~/.zshrc 文件,将 ZSH_THEME 设为 haoomz。当然你也可以设置为其他主题,例如lukerandall、robbyrussell。
卸载 Oh My Zsh