Zsh Installation and Configuration Guide (Kerim User Example)#
Zsh (Z Shell) is a powerful, flexible, and visually enhanced shell for terminal users. This guide covers how to install and configure Zsh on an Ubuntu system for a user named kerim.
1. Installing Zsh#
Install Zsh on your system with the following commands:
sudo apt update
sudo apt install zsh -y
Verify the installation:
zsh --version
Set Zsh as the Default Shell#
To set Zsh as the default shell for the kerim user:
chsh -s $(which zsh) kerim
To start using Zsh, the user should log out and log back in.
2. Installing Oh-My-Zsh#
Install Oh-My-Zsh, a popular framework for managing Zsh configuration:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Zsh will automatically be loaded after installation.
3. Theme and Plugins#
Choosing a Theme#
Oh-My-Zsh comes with many themes. Let’s use the "agnoster"
theme as an example.
Open the Zsh config file:
nano ~/.zshrc
Find and change the line:
ZSH_THEME="agnoster"
Apply the changes:
source ~/.zshrc
Useful Plugins#
Enhance your shell with additional plugins. Popular ones include:
git
: Shortcuts for Git commandszsh-autosuggestions
: Suggests commands as you typezsh-syntax-highlighting
: Highlights commands with color
To enable them, find the plugins
line in your ~/.zshrc
and update it:
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
Installing Required Plugins:
Clone the plugin repositories:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Reload Zsh:
source ~/.zshrc
4. Improve Terminal Appearance#
Install Powerline Fonts#
Themes like Agnoster require Powerline fonts:
sudo apt install fonts-powerline -y
Then, select a Powerline-compatible font in your terminal emulator settings.
5. Testing the Zsh Profile#
To ensure Zsh is working correctly, open a new terminal session and test basic commands and features.
By completing these steps, the user kerim will have a fully configured and powerful Zsh environment. You can now continue customizing your terminal to fit your workflow and style! 🎉