Scott

How to Install Zsh on Ubuntu a year ago

linux
tools
1193个字符
共有127人围观

install zsh

sudo apt update
sudo apt install zsh -y

# check the installed version
zsh --version  #zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

#Initial Configuration, 选择0
zsh 

#Set Zsh as Default Shell
echo $SHELL
chsh -s $(which zsh)

Install Oh My Zsh

sh -c "$(wget --no-check-certificate https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

编辑配置文件: ~/.zshrc

ZSH_THEME="robbyrussell"改为 ZSH_THEME="jonathan" or ZSH_THEME="ys"

保存 退出

要想使配置生效,还需source一下

Enable Auto-Suggestions

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

编辑配置文件: ~/.zshrc

修改plugins配置

plugins=(git zsh-autosuggestions)

Enable Syntax Highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

编辑配置文件: ~/.zshrc

修改plugins配置

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Uninstall Zsh

sudo apt --purge remove zsh

Change the default shell back to Bash (or any other you want):

chsh -s $(which bash)