Get a prettier SHELL
Z Shell (zsh)
Key Features
- Interactive Shell: Zsh provides a highly interactive shell experience with features like advanced tab completion, spelling correction, and syntax highlighting.
- Extensive Customization: Users can customize Zsh to suit their preferences and workflow by configuring various options and settings. This includes defining aliases, customizing prompt appearance, and setting up plugins and themes.
- Powerful Tab Completion: Zsh’s tab completion is highly sophisticated and can complete commands, filenames, options, and even suggest completions based on the context.
- Plugin System: Zsh has a rich ecosystem of plugins and extensions that add additional functionality and integrations with other tools and frameworks.
- Advanced Scripting: Zsh supports advanced scripting features, including associative arrays, parameter expansion, and various control structures, making it suitable for writing complex shell scripts.
Install
Check current SHELL:
echo $SHELL
If the output is
/usr/bin/zsh
, you do not need to reinstall. Proceed to install OhMyZsh.On Ubuntu/Debian:
sudo apt update sudo apt install zsh
On CentOS/RHEL:
sudo yum install zsh
On macOS using Homebrew:
brew install zsh
Verify
After installation, you can verify if Zsh is installed by running:
zsh --version
Set Zsh as Default Shell
Set Zsh as the default shell:
chsh -s $(which zsh)
For the changes to take effect, log out of your shell session and log back in or restart your computer.
Oh My Zsh
Oh My Zsh is a delightful, open-source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and more.
Install
Install OhMyZsh with
curl
:sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Or with
wget
:sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
Theme
- You can use any theme from Zsh by manually setting it in the Zsh profile file
~/.zshrc
.
For example:
ZSH_THEME="robbyrussell" # Edit this line
Plugin
You can also use Plugins depending on your purposes and preferences.
Powerlevel10k
Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility, and out-of-the-box experience.
Install Fonts
Download the fonts:
Install the fonts by right-clicking and selecting “Install,” or copy the font files to:
~/.local/share/fonts
(for a user-specific installation)/usr/local/share/fonts
(for a system-wide installation)
Start the Powerlevel10k installation:
- Clone the repository:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Set
ZSH_THEME="powerlevel10k/powerlevel10k"
in~/.zshrc
.Reload the Zsh profile:
source ~/.zshrc
Note: It will start asking you some questions to customize your shell. Choose according to your preferences.
In the final step - Instant Prompt Mode, choose option (3) Off.
Done!
Leave a comment