Ditch Your Boring Terminal and Make it More Useful
Tags: react, node, javascript, aws
Published: 2024-05-11 11:00:13

To read more articles like this, [visit my blog](https://www.mohammadfaisal.dev/blog)

![Expected design](https://cdn-images-1.medium.com/max/3560/1*YFmXV59l20C0HqxXgmmMiQ.png)

Contrary to popular opinion, programmers are human. We like nice things. And the terminal is one of the most important things that we use on a day-to-day basis.

So why live with a boring terminal when you can make it colourful and fun?

Today, we will do precisely that. Let’s begin!

## Install Homebrew

If you are using a mac, you are most probably already familiar with [homebrew](https://brew.sh/). It helps with installing software on macOS.

Run the following command:

```
/bin/bash -c "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh](https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh))"
```

You may need to install the CLI tools for XCode before that:

```
xcode-select —-install
```

If you get an error, run the following command to reset:

```
xcode-select -r
```

And that’s it!

## 2. Install Iterm2

[Iterm2](https://iterm2.com/) is a terminal emulator for macOS. It’s kind of a replacement for your original terminal. It comes with a bunch of cool features and customizations that we will go over later

Run the following command:

```
brew cask install iterm2
```

## 3. Install ZSH

[ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH), also called the Z shell, is an extended version of the Bourne Shell (sh). it has some advanced features like

* Automatic cd: Just type the name of the directory.

* Plugin and theme support: ZSH has many plugin and theme frameworks to boost up your terminal even more.

To install it run the following command:

```
brew install zsh
```

And you should be set up.

## 4. Install Oh My ZSH

According to their [website](https://ohmyz.sh/)…

>  Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration

In short, it will help you to manage the configuration and customizations for your Z Shell.

To install, run the following command:

```
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```

Okay, now, you have the basic setup complete.

You should already have a nice-looking terminal than before.

## 5. Customize the Theme

Now restart your iTerm2 and type the following command:

```
open .zshrc
```

it will open the config file with a text editor. You can also use nano if you like.

Now there will be a variable named `ZSH_THEME` . And the value there is `robbyrussell` . If we set it to random, then every time we open our terminal, a new theme will be loaded

![ZSH THEME](https://cdn-images-1.medium.com/max/2000/1*5OtbygU3hHB-q8lqVQxKYA.png)

However, you can choose from a wide variety of themes [here](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes).

Let’s use a popular custom theme named [powerlevel10k](https://github.com/romkatv/powerlevel10k). First, install it.

```
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
```
Then set the theme name:

```
ZSH_THEME="powerlevel10k/powerlevel10k"
```

Then save the file and run the following command from the terminal:

```
exec zsh
```

Then open iterm2 again and configure the terminal by running the following command:

```
p10k configure
```

It will take you through the configuration process and at the end of it, you will have a nice-looking terminal!

![Colorful Terminal](https://cdn-images-1.medium.com/max/2612/1*whrUnqpW-OMhs8utZzkPtQ.png)

## 6. Customize with Plugins

Plugins are what make the zsh so powerful and fun to use. There are a lot of plugins that you can find [here](https://project-awesome.org/unixorn/awesome-zsh-plugins). Let’s try one of them!

Do you like typing? I guess not. We can have some autosuggestion inside our terminal by using a plugin named [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions).

Run the following command.

```
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
```

Then open up your `.zshrc` file. And find the plugins section. You will see there is already a `plugin` there (git). Add our new plugin.

![ADD A NEW PLUGIN](https://cdn-images-1.medium.com/max/2000/1*ZqaX3OojsuOS0_z71Y_N-A.png)

That’s it. Now when you want to type a command the terminal will give you suggestions!

![Auto Suggestions](https://cdn-images-1.medium.com/max/2612/1*NJNZWQxnpJ8ZXHwkLH5uyg.png)

## Final Thoughts

There are a lot of things that you can do with oh my `zsh` . I have shown the absolute basics here. I hope you enjoyed it.

Have a great day!

Resources:

* [https://www.freecodecamp.org/news/how-to-configure-your-macos-terminal-with-zsh-like-a-pro-c0ab3f3c1156/](https://www.freecodecamp.org/news/how-to-configure-your-macos-terminal-with-zsh-like-a-pro-c0ab3f3c1156/)

* [https://medium.com/tech-explained/4-simple-steps-to-create-an-awesome-terminal-experience-on-your-mac-70bd7a0e1b59](https://medium.com/tech-explained/4-simple-steps-to-create-an-awesome-terminal-experience-on-your-mac-70bd7a0e1b59)

**Have something to say? Get in touch with me via [LinkedIn](https://www.linkedin.com/in/56faisal/) or [Personal Website](https://www.mdfaisal.com/)**