This article mainly records the process of installing Zsh, which is convenient for subsequent equipment installation! Learn together with everyone! (Ubuntu 20.04)
install zsh
sudo apt install zsh
2. Download oh-my-zsh and install it
# GitHub方式
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# 下载网速慢的话可以用gitee
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh
sudo cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
3. Switch shell to zsh
chsh -s /bin/zsh
We can see that restarting the terminal will change
In the past, our bash editing files were all in ~/.bashrc
Now our zsh editor file is in ~/.zshrc
after that
source ~/.zshrc
It was originally like this:
echo $SHELL
after reboot
4. Plugins!
The next step is the key link, add plug-ins!
zsh comes with: extract
After decompression, you only need to extract + file name , you can decompress zip, tar.bz2, gz files
Download plugin:
zsh-autosuggestions:
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
zsh-syntax-highlighting:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
autojump : fast switch directory plugin
# 安装
sudo apt install autojump
# 使用
autojump Document/
plugins=(git
zsh-autosuggestions
zsh-syntax-highlighting
extract
autojump
)
Solve the Caton problem
Sometimes the execution of cd will freeze, which is unbearable. The reason is that oh-my-zsh is getting git information, and git information can be hidden:
git config --global oh-my-zsh.hide-status 1