I have been using Zsh for a really long time. Why? I don't know just because. And, it is pretty cool. You can get a ton of customizations make your terminal look better and feel help yourself feel like a better developer (you r not).
Well, anyways I sort of fked up my graphic drivers and has to reinstall Ubuntu and set up everything (including Zsh) so I thought I'd write article while I am at it.
Psh, this setup is for Ubuntu only, incase u didn't read the title ;)
What is Zsh?
Zsh(short for Z shell
) is a shell...
Ok so on a serious note, Zsh is a program that lets you interact with your computer using commands instead of clicking around with a mouse. So... it is a shell.
That's it.
The great thing about Zsh however is that it has a ton of options for customizations unlike Bash
which is the default shell in Ubuntu.
Why is Zsh better than Bash?
- Rich customization
- Better plugins
- Stronger autosuggestions and tab completions
- Cooler
(isn't this so much better that out of the box bash?)
Setting up Zsh
1) Make sure your system is up to date before starting.
sudo apt update && sudo apt upgrade -y
2) Install Zsh
sudo apt install zsh -y
3) Change default shell to Zsh
chsh -s /usr/bin/zsh
You may need to restart the terminal for this to take place.
4) Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Oh My Zsh allows you to easily manage your Zsh configuration.
5) Install powerline fonts
sudo apt-get install fonts-powerline
Helps improve prompt visuals
6) Install powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Powerlevel10k is a custom theme for Zsh. Like dark/light themes, but more powerful
7) Install dconf-cli
sudo apt-get install dconf-cli
8) Install Zsh Plugins
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
Zsh has a lot of plugins. These 2 will give syntax highlighting and autosuggestion based on history.
9) Update ~/.zshrc
Now we need to update the
~/.zshrc
file so that all the changes we have made can take effect.
nano ~/.zshrc
Find a line which says
ZSH_THEME="<theme_name>"
and replace it withZSH_THEME="powerlevel10k/powerlevel10k"
Find a line which says
plugins=(git)
and replace it withplugins=(git zsh-autosuggestions zsh-syntax-highlighting)
Now exit the editor and apply the changes you made using
source ~/.zshrc
10) Customize using powerlevel10k
You can now use the powerlevel10k (p10k) theme to customize your terminal. It will ask you some questions which you just have to answer and you will be done.
It is possible that the configuration will run automatically after you source
the .zshrc
file. If it does not then you can run it with the following command. This can be repeated anytime in the future.
p10k configure
And you are done.
If at any point some effects do not seem to take place close and reopen the terminal.
Thanks. Bye.
Top comments (1)
Cool!