Boost your terminal productivity with Zsh
Enhance Your Terminal: Why Zsh is Better than the Default Bash
Install Zsh
Ubuntu
sudo apt update
sudo apt install zsh
Arch Linux
sudo pacman -S zsh
Fedora
sudo dnf install zsh
After install, run zsh
in your terminal, it will show like this, you just need to press 0
then Enter
This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~). This function can help you with a few settings that should
make your use of the shell easier.
You can:
(q) Quit and do nothing. The function will be run again next time.
(0) Exit, creating the file ~/.zshrc containing just a comment.
That will prevent this function being run again.
(1) Continue to the main menu.
--- Type one of the keys in parentheses ---
Set Zsh as Your Default Shell
After installing Zsh, make it your default shell by running
sudo chsh -s $(which zsh)
Log out and log back in for the changes to take effect.
Install Oh My Zsh
Oh My Zsh is a popular framework for managing Zsh configurations. It comes with a wide range of plugins and themes to enhance your shell experience.
Install Oh My Zsh with this command:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
While installing, it will as you like Do you want to change your default shell to zsh? [Y/n]
then you press Y
then Enter
Install plugins and themes
Plugins
zsh-autocomplete
git clone https://github.com/marlonrichert/zsh-autocomplete.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autocomplete
zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Themes
You can find your favorite themes at this github repo
Configure Zsh
To enable the plugins, open your .zshrc
file:
nano ~/.zshrc
Find the plugins=
line and add zsh-autocomplete
and zsh-syntax-highlighting
:
plugins=(git zsh-autocomplete zsh-syntax-highlighting)
Find the ZSH_THEME=
line and add theme name
ZSH_THEME="strug"
Update config by run this command
source ~/.zshrc
Conclusion
Congratulations! You’ve successfully installed Zsh with zsh-autocomplete and zsh-syntax-highlighting on your Linux system. Whether you’re using Ubuntu, Arch Linux, or Fedora, these tools will transform your terminal into a productivity powerhouse.
If you found this guide helpful, share it with your friends and colleagues. Have questions or run into issues? Leave a comment below, and I’ll be happy to help!