Best Terminal Setup | ZSH
Tags: zsh, ohmyzsh, terminal, linux
Published: 2020-12-18 12:43:56

I recently tried new terminal configuration with [ZSH](https://en.wikipedia.org/wiki/Z_shell) shell, [Oh-My-Zsh](https://ohmyz.sh/) framework and [Powerlevel10k](https://github.com/romkatv/powerlevel10k) theme on [Terminator](https://terminator-gtk3.readthedocs.io/en/latest/) terminal emulator. 
So, I want to share it with you.
[Go to shell setup part >](#instzsh)
<!--more-->
*** 

# 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.

```bash
sudo apt install -y terminator
```
Open it.
![Terminator](https://dev-to-uploads.s3.amazonaws.com/i/1s1r73obqwykq431f9is.png)

<a name="instzsh"></a>
## Install ZSH
```bash
sudo apt install -y zsh
```
> To make it your default shell run:
> `chsh -s $(which zsh)` in command line

![zsh](https://dev-to-uploads.s3.amazonaws.com/i/281l8z2fg5mcpuba9zas.png)

Other ways of installation you can find in [official GitHub repo](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)

### Oh-My-Zsh framework
Install OMZ with shell script, which will setup default themes and plugins.
```bash
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
```

###  PowerLevel10k Theme 

Install [special font](https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k) for better display of icons. I recommend [MesloLGS NF Regular.ttf](https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf). After fonts proceed to theme.

![Font install](https://dev-to-uploads.s3.amazonaws.com/i/i32jdfhedaapk42wxzic.gif)

```bash
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 
```bash
source ~/.zshrc
```
and configure it as you wish.

![p10k](https://dev-to-uploads.s3.amazonaws.com/i/a6u2bdlihixzc07e28ja.gif)

> To reconfigure theme, use `p10k configure` command.

#### Default plugins
You can enable IP, battery and other default plugins editing `.p10k.zsh` file.

```bash
nano $HOME/.p10k.zsh
``` 
![defplugins](https://dev-to-uploads.s3.amazonaws.com/i/t8jv2p7oqe1sk4x6t12m.png)

#### External plugins
##### Syntax-highlighting
> For more information visit [official repo](https://github.com/zsh-users/zsh-syntax-highlighting)

Clone plugin to `$ZSH_CUSTOM/plugins`
```bash
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
```bash
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`

![syntax](https://dev-to-uploads.s3.amazonaws.com/i/k08jvzw9sh7crb8p2him.png)

> Rerun shell with this command: `zsh`

##### Autosuggestions
> For more information visit [official repo](https://github.com/zsh-users/zsh-autosuggestions)

Clone plugin to `$ZSH_CUSTOM/plugins`
```bash
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
```
Then change `~/.zshrc` file
```bash
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`

![autosug](https://dev-to-uploads.s3.amazonaws.com/i/t3hg5utht9jo05g9xmue.png)

> Rerun shell with this command: `zsh`

# That's all!
After all these actions, you will get something like this:

![total](https://dev-to-uploads.s3.amazonaws.com/i/9oqpycgpx4hxygcm5cr6.gif)

Give some feedback and share screenshots of your terminal themes! 

***

I was inspired by these articles:
{% link https://dev.to/web3coach/best-terminal-setup-terminator-zsh-powerlevel10k-7pl %}
{% link https://dev.to/deepu105/configure-a-beautiful-terminal-on-unix-with-zsh-4mcb %}