Getting started with customizing the terminal 
Tags: unix, zsh, frameworkmanager, dracullatheme
Published: 2019-09-23 18:04:57

This tutorial will teach you the basics of terminal customization. I hope you can tag along so you can start customizing your terminal too. On a side note though: this post assumes you’re either using macOS or Linux. Additionally, I assume you have Git and Vim installed, and that you’re using a package manager such as<a href = "https://brew.sh/" > Homebrew</a>.  

<h2> The Z Shell </h2>

In order to start making changes to the terminal, it's necessary to download and install a _UNIX_ shell. More specifically, the UNIX shell we're using is a refined bundle of tools that allows us to make use of the terminal in a more specific way. Think of it as an improved version of the command line. In this case, we’re using _Zsh_, also known as _The Z Shell_, an open-source UNIX shell that has been used by thousands of users and also happens to be open-source. Refer to <a href = "https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH"> this</a> piece of documentation on GitHub written by  <a href = "https://github.com/robbyrussell"> Robby Russel</a> for a well-written in-depth guide on how to install Zsh.
 
![[1]installingZSH](https://thepracticaldev.s3.amazonaws.com/i/h39xy5h8bupczxqd4nvk.png)

It's always a good idea to execute the _-- version_ command once the installation is complete. This helps us make sure the installation went through successfully. It should look like this:

![[2]zsh-version@2x](https://thepracticaldev.s3.amazonaws.com/i/hees2s7p2pcahxl4hw9i.png)


Once you execute _-- version_, the output message should be similar to this: 

![[3]zsh-version@2x](https://thepracticaldev.s3.amazonaws.com/i/c8f8tw9dvrknk5jt1ukd.png)

<h2> Oh My Zsh </h2>

To make things even better, we’re also installing a framework manager that will help us, well, manage the configurations we judge necessary in the future. While Zsh is what allows us to start tweaking the terminal, Oh My Zsh is where the magic happens. It comes with more than 100 plugins and themes available which is more than enough customization for users like me. Because I have friends that love creating their own plugins and themes, it is also worth noting that Oh My Zsh is open-source. So, rest assured: if you happen not to find what you’re looking for in their catalog, you can certainly build it yourself!

I recommend installing it using _cURL_: 

![[4]wget@2x](https://thepracticaldev.s3.amazonaws.com/i/657j69mjvd3arhetb20b.png)_sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"_


However, you can also run _Wget_ as opposed to cURL:

![[4]curl@2x](https://thepracticaldev.s3.amazonaws.com/i/tzt7mq78o5q7995gduan.png)_sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"_

During either of those two installation processes, you might get prompted with something like this:

![[5]defaultshell@2x@2x](https://thepracticaldev.s3.amazonaws.com/i/qj7dfwbrwldoenqr4iul.png)

To which you simply press _y_ and hit enter.


At this point, any changes that you’d like to take effect on the terminal window you're using should be made on the ~/.zshrc file and __not__ to  _~/.bash-profile_.

![[6]ohMyZsh@2x](https://thepracticaldev.s3.amazonaws.com/i/0vi07w2heo5lkr5ejvjk.png)


<h2> Useful Plugins with Zplugin </h2>

Because this is an introductory post, we’ll keep things simple. As such, we need to install<a href = "https://github.com/zdharma/zplugin" > Zplugin</a> which brings useful tools such as command suggestions, auto-completion, and syntax-highlighting. 

Execute the following via cURL:

![[7]zPlugin@2x](https://thepracticaldev.s3.amazonaws.com/i/s0sj4zh1gp6z326j4end.png)_sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zplugin/master/doc/install.sh)"_

Once the installation is complete, the output message should be similar to this: 


![[9]zplugininstall@2x](https://thepracticaldev.s3.amazonaws.com/i/uutbodtf7e130c8z85fq.png)

Now, for this next step, we will be using _Vim_. If you don't have much experience with Vim, it's highly recommended that you <a href = "https://www.openvim.com/" > practice</a> a bit before continuing. The reason being, it’s not hard to mess something up while using it if you don’t know what you’re doing.

Open _~/.zshrc_ using Vim:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6o1dnh6fv2tjf45w0hqy.png)


At the end of the file, find the line that reads “###End of Zplugin installer’s chunk” and add the following:


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5crcsul76k3k44r4ace9.png)

Since we’re using Vim, once those three lines are added, simply press _ESC_, _and_ _:wq_.

Done! You now have command suggestions, auto-completion, and syntax-highlighting.

<h2> Installing Your First Theme </h2>

I just so happen to be using the so-called “Dracula" theme made available by <a href = "https://zenorocha.com/" > Zeno Rocha</a>. Check it out using  <a href = "https://draculatheme.com/" > this</a> link.

Before you start the installation process though, you might need to go through an extra step. That is if you’re using macOS. To agree with Xcode's license agreements, execute the following:

![[11]xCodeLicense](https://thepracticaldev.s3.amazonaws.com/i/rcvdspafhm8szqy9jv4i.png)_sudo xcodebuild -license_


Once you have agreed to Xcode's license agreements, it’s time to clone the Dracula theme into Oh My Zsh’s folder:


![[12]gitHubClone@2x](https://thepracticaldev.s3.amazonaws.com/i/jvmtjqv1vru62bswh4ti.png)

Now, let’s edit _~/.zshrc_ once again using Vim, and set it Dracula:

![[13]setVim@2x](https://thepracticaldev.s3.amazonaws.com/i/q8vhse6fgv0n5ldgbh5o.png)

<h2> Final Thoughts </h2>

Once everything is fully installed, I recommend restarting your machine so that we can make sure the CPU is refreshed and that the changes we made throughout this tutorial can take effect. As a software developer myself, I sure spend a considerable amount of time using the terminal. Tailoring it to my needs only makes sense - and you should, too!