How to install custom plugins and themes with Oh-my-ZSH
Tags: webdev, tutorial, terminal, zsh
Published: 2020-12-19 12:34:05

*This post was first published on my [blog](https://blog.larsbehrenberg.com) and is the 2nd part of my series about iTerm2 and Oh-My-ZSH.

*In the [first part of the series](https://blog.larsbehrenberg.com/the-definitive-iterm2-and-oh-my-zsh-setup-on-macos), we talked about how to install and set up your terminal to get you up and running quickly and with little effort, but with functionality and style.*

*Now we want to dive a little deeper, go past the default plugins, and explain a little more about Oh-My-ZSH and how it works.*

## Table Of Contents

-  [Where to find your plugins and themes](#where-to-find-your-plugins-and-themes) 
    -  [Plugins](#plugins) 
    -  [Themes](#themes) 
-  [How to install custom plugins & themes](#how-to-install-custom-plugins-amp-themes) 

## Where to find your plugins and themes

Now that we have set up our iTerm2 with Oh-My-ZSH, let's try to understand what it is we installed and we are the files to configure it.

### Plugins

When we setup up our default plugins in the *[first part of this series](https://blog.larsbehrenberg.com/the-definitive-iterm2-and-oh-my-zsh-setup-on-macos)*, we simply added them to the array of plugins listed in the ***~/.zshrc***, like so:

```bash
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
	git
	brew
	heroku
	gatsby
	yarn
)
```

**but how did they get installed from there?**

What you might not know is that, during our installation of Oh-My-ZSH, all of the plugins that are listed in the [official documentation](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) were installed at ***~/.oh-my-zsh/plugins***. So, that once you add a plugin in the array and restart iTerm2, all that Oh-My-ZSH needs to do is to fetch that already installed plugin from the plugin folder and give you a **seeming less experience**.

If you want to have a look yourself what plugins you currently have installed simply execute this, to see all the plugins your terminal:

```bash
ls ~/.oh-my-zsh/plugins
```

Or this to view in your Finder:

```bash
open ~/.oh-my-zsh/plugins
```

### Themes

The same counts for your themes! On installation of Oh-My-ZSH, lots of different themes were installed for you to be accessed at any time. Just swap out plugins for themes in your terminal command and you will see all the current themes installed.

To see installed themes in your terminal:

```terminal
ls ~/.oh-my-zsh/themes
```

Or to see them in your finder, write: 

```bash
open ~/.oh-my-zsh/themes
```

From here, you can go off on your own and look around in your ***~/.oh-my-zsh***, try to understand the different subfolders and config files.

However, in this tutorial, we will stick to themes, plugins, and the *~/.zshrc* config file to config everything.

**So let's get going!**

## How to install custom plugins & themes

We now know that Oh-My-ZSH looks for plugins and themes in the respective directory under ***~/.oh-my-zsh***.

So... Does that mean we simply have to create a folder with a custom plugin/theme in that directory and Oh-My-ZSH will be able to source it on start?

**That's exactly it.**

You add a folder with the custom plugin in your plugin directory and you are good to go.

Some people however prefer to put their custom plugins, themes, and configuration in a "custom" folder within the ***~/.oh-my-zsh*** directory. By default this folder is called: ***~/.oh-my-zsh/custom*** and then for example for plugins go into: ***~/.oh-my-zsh/custom/plugins***

Oh-My-ZSH will by default be able to source your plugins from there as well, but it's really up to you. You can add your custom plugins to the general plugin directory or your custom plugin directory. It's only personal preference.

> One quick note here: Be wary, your terminal might slow down, the more plugins you add to your config. Add your plugins wisely!

**Now let's add a custom plugin.**

Oh-My-ZSH provides us with a small list of custom plugins to choose from in their official repo:

[Oh-My-ZSH Custom Plugin list](https://github.com/ohmyzsh/ohmyzsh/wiki/External-plugins)


And in this tutorial, we will go with the most enjoyable one of that list:

["Dogesay" Custom ZSH plugin](https://github.com/txstc55/dogesay)

This plugin lets doge repeat your command every time you write in your terminal. Wait for it, **it's going to be awesome**.

To install the plugin we will have to download the plugin and move it into the correct directory. In this case, since it's a plugin: ***~/.oh-my-zsh/plugins***

Let's do this in one command:

```bash
git clone https://github.com/txstc55/dogesay ~/.oh-my-zsh/plugins/dogesay
```

This clones the plugin from GitHub right into your new dogesay folder within ***~/.oh-my-zsh/plugins.***

So that now, all that is left to do is to add the plugin to our array of plugins in our ***~/.zshrc.***

For text editor users:

```bash
open ~/.zshrc
```

Or VIM users:

```bash
vim ~/.zshrc
```

And add the plugin to this list:

```bash
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
	git
	brew
	heroku
	gatsby
	yarn
	dogesay
)
```

**Restart your terminal and done!** Every time you enter a command in your terminal doge will make sure you know what you just entered! **And with this, you have set up your first CUSTOM plugin.** The same process works for all other custom plugins and themes. But if you do have any questions make sure to reach out to me on [Twitter](https://twitter.com/codetraveling) 🙂

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/b4iejyt3jkosaeu150h9.png)

**To get the coloring and bigger font for the callout, you will have to install "figlet" and "lolcat" with:**

```bash
brew install figlet lolcat
```

There are lots of custom plugins and themes out there with a big community developing and maintaining them. It's well worth checking some of them out. **Who knows, maybe you might even want to submit a pull request to one of them!** 

One plugin that I use is:

[Oh-My-ZSH Reminder](https://github.com/AlexisBRENON/oh-my-zsh-reminder)

This plugin lets you create little to-do lists right within your terminal, so you can jot down little things that you need to get done until the end of your day. Hope you like it!

## That’s pretty much it!

Thanks so much for reading this far and feel free to reach out to me anytime, on [my website](https://larsbehrenberg.com/) or [Twitter](https://twitter.com/codetraveling) 🙂  And if you like to read more, make sure to check out my other posts on my [blog](https://blog.larsbehrenberg.com)!