Install Zsh on the Raspberry Pi

The previous article said that the Raspberry Pi, which has been idle for more than a year, has been built to build a running environment, so how can we face such an ugly Bash, of course, it must be replaced by zsh.

Step

  1. Install zsh
  2. Install oh-my-zsh
  3. Change default terminal
  4. Change theme of zsh

Install Zsh

Zsh is a powerful terminal with many advantages. See them in This.

1
sudo apt-get install zsh -y

Install Oh-my-zsh

Oh-my-zsh is a one-click configuration tool for use with zsh.

1
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Change Default Terminial

Make sure there is no problem before you change it.

1
chsh -s /bin/zsh

Change Theme

Edit theZSH_THEME in ~/.zshrc

They are many choices, you can try more, I use ys.

———-2018.03.14 update————

Plugin

I used 4 plugins, which are git, extract, zsh-autosuggestions, zsh-syntax-highlighting. Where git and extract are provided by oh-my-zsh, the other two need to be installed separately. Configured in .zshrc as follows:

1
2
3
plugins={
git extract zsh-autosuggestions zsh-syntax-highlighting
}
Zsh-autosuggestions

Official Github Address had introduced a log, I used the manual installation method:

1
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions

Then add in the bottom of .zshrc:

1
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
Zsh-syntax-highlighting

This one is easy to install by apt:

1
apt-get install zsh-syntax-highlighting

———-2019.03.12 update————

Then add in .zshrc:

1
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

source /usr/share/zsh-syntax-highlighting/zsh-highlighting.zsh