I recently tried new terminal configuration with ZSH shell, Oh-My-Zsh framework and Powerlevel10k theme on Terminator terminal emulator.
So, I want to share it with you.
Go to shell setup part >
What we will setup?
- Terminator terminal to support splitting the terminal screen vertically and horizontally into multiple windows. Extremely useful when working with distributed systems like blockchain.
- ZSH a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting with many plugins and themes.
- Oh-My-Zsh open source, community-driven framework for managing Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins & themes.
- Powerlevel10k theme for ZSH. It looks better in a bundle with Oh-My-Zsh.
Installation
I do everything on Ubuntu 20.10, but there will be no difference on RHEL or Arch except for package manager.
Install the Terminator
Open terminal with (
Ctrl + Alt + T
) or find in Apps.
sudo apt install -y terminator
Install ZSH
sudo apt install -y zsh
To make it your default shell run:
chsh -s $(which zsh)
in command line
Other ways of installation you can find in official GitHub repo
Oh-My-Zsh framework
Install OMZ with shell script, which will setup default themes and plugins.
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
PowerLevel10k Theme
Install special font for better display of icons. I recommend MesloLGS NF Regular.ttf. After fonts proceed to theme.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
sudo echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
If you don't have curl & git =>
sudo apt install -y curl git
Configure colors, spaces & other features
Rerun ZSH
source ~/.zshrc
and configure it as you wish.
To reconfigure theme, use
p10k configure
command.
Default plugins
You can enable IP, battery and other default plugins editing .p10k.zsh
file.
nano $HOME/.p10k.zsh
External plugins
Syntax-highlighting
For more information visit official repo
Clone plugin to $ZSH_CUSTOM/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Then change ~/.zshrc
file
nano $HOME/.zshrc
and near to the End of the file find string plugins
. Separated by a space add name of plugin name zsh-syntax-highlighting
Rerun shell with this command:
zsh
Autosuggestions
For more information visit official repo
Clone plugin to $ZSH_CUSTOM/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Then change ~/.zshrc
file
nano $HOME/.zshrc
and near to the End of the file find string plugins
. Separated by a space add name of plugin name zsh-autosuggestions
Rerun shell with this command:
zsh
That's all!
After all these actions, you will get something like this:
Give some feedback and share screenshots of your terminal themes!
I was inspired by these articles:
Top comments (1)
If you install only the regular font, bold and italic text in the terminal won't look very nice. It's a good idea to install all four ttf files as described in github.com/romkatv/powerlevel10k#m....