---
title: "Terminal: The Konami Code for Your Terminal"
description: "Notice: This is a little \"terminal treat\" – a short tip rather than a whole article. Enjoy!"
date: 2025-04-27
canonical_url: "https://christofersandin.com/texts/terminal-the-konami-code-for-your-terminal"
section: "Texts"
---

#  Terminal: The Konami Code for Your Terminal 

**Notice: This is a little "terminal treat" – a short tip rather than a whole article. Enjoy!**

**To make the terminal on macOS a bit nicer, I thought we could use the famous *Konami Code* to give our friend some extra functions that improve everyday life.**

These are entirely subjective opinions from someone who uses the terminal more often now than before. Many things are much faster to do there compared to doing the same thing in other programs and interfaces, so once you get used to it, it’s hard to stop.

It’s also time for me to change computers, and it would be nice to have a guide to follow, since I always start every new computer with a completely fresh installation. This approach provides a fresh start and is a strategy that has worked well for me for nearly twenty years.

However, in addition to mentally pressing the classic code ⬆️ ⬆️ ⬇️ ⬇️ ⬅️ ➡️ ⬅️ ➡️ 🅱️ 🅰️, you need to take a couple more steps.

Stay tuned!

---

## ⬆️ ⬆️ – Install the basics

A few things are essential, and if you’re going to work with some form of development on a Mac, these are some of the first things you need to install to have a functioning environment.

- Xcode
- Node.js
- Homebrew
- iTerm2 (or other terminal application)

### Install the CLI Tools for Xcode

You can certainly install the full *Xcode* via the App Store, but isn’t it convenient to get the Command Line Tools through the terminal instead?

```
xcode-select --install

```

### Install Node.js and npm

Start by following the instructions at <https://nodejs.org/en/>.

Then, one more thing makes everyday life smoother: install all global packages in your home directory instead of the system directory (the default). We do this to avoid permission issues and having to type `sudo` before all npm installations for all eternity…

```
mkdir ~/.npm-global 
npm config set prefix '~/.npm-global'

```

We also need to add the path in `.zshrc` so that we can use the packages from anywhere:

```
# Node.js global folder in ~/.npm-global
export PATH=~/.npm-global/bin:$PATH

```

## Homebrew

*Homebrew* is a package manager for macOS. Let’s install it and then use that to install the other packages.

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

```

## Install a new terminal emulator

I use *iTerm2* instead of the built-in terminal. Several little things are quite a lot nicer, and I’ve gotten used to them.

There are other options today, and I’m currently testing both [Ghostty](https://ghostty.org/) and [WezTerm](https://wezfurlong.org/wezterm/index.html), but "if it ain’t broke, don’t fix it" works for me in this case.

```
brew install --cask iterm2

```

To make adjustments, you modify the file `.zshrc`:

```
vim ~/.zshrc

```

## ⬇️ ⬇️ – Install "Oh My Zsh"

Nowadays, macOS comes with *Zsh* as the shell instead of *Bash*.

I have been using Zsh for many years, so this is something I appreciate, but to make Zsh even better, an easy win is to install *Oh My Zsh*:

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

```

## Plugins

I use a few external plugins that need to be installed and some that come included but need to be activated in `.zshrc`.

- zsh-autosuggestions
- k

With the two installed above, my `.zshrc` looks like this:

```
plugins=(git npm extract k)
source $ZSH/oh-my-zsh.sh
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

```

### Themes

There are also a number of different themes, and right now, I’m using *af-magic*, which I’m pretty happy with.

## ⬅️ – Fonts with superpowers

To get a bit more out of the terminal, you can install some *Nerd Fonts*. Here, we install it together with the Hack typeface.

```
brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font

```

## ➡️ – Nicer colors

To improve the colors in the terminal, I like *vivid*, which I came across recently. We use Homebrew again to install:

```
brew install vivid

```

One little "gotcha" is that you also need to install the GNU version of `ls` instead of the BSD version included with macOS to be able to use the colors:

```
brew install coreutils

```

Then you can set the colors you want to use along with a little alias in `.zshrc` to make everything look tidy:

```
# Vivid colors
export LS_COLORS="$(vivid generate molokai)"
alias ls="gls --color"

```

Here with the *molokai* colors.

Note: Another approach is to skip this step and let the various tools inherit the color scheme you have defined for your terminal.

## ⬅️ – More superpowers

I use about a dozen commands in the terminal most of the time, but there are a few commands that I benefit from every day, and the most used is `z`, which this list starts with. The others are good, too, but they’re used much less frequently.

### z / zoxide

If there’s one command you should install, it’s `z`. With `z`, you can jump around among the directories you use the most using fuzzy shortcuts.

```
brew install z

```

Add to `.zshrc`:

```
# z
. $(brew --prefix)/etc/profile.d/z.sh

```

This means you can type `z site` instead of `cd ~/Sites`, for a simple example. It is invaluable if you work in the terminal.

*Zoxide* is a more modern version of `z` above. It’s a little faster and has support for `fzf`, which makes it a bit more versatile. Works more or less in the same way:

```
 brew install zoxide

```

Add to `.zshrc`:

```
# zoxide
eval "$(zoxide init zsh)"

```

This will give you access to another `z` command, as well as the `zi` command, which shows an interactive display of matches.

Use `z` OR `zoxide`.

### lsd

With Nerd Fonts in place, we can also install *LSD*, which stands for LSDeluxe and nothing else, using Homebrew:

```
brew install lsd

```

I’m not the biggest fan, but it might suit you.

### htop / btop

It’s not something I use daily, but *htop* is an updated version of *top* that shows active processes and memory usage in the terminal. It can be installed with:

```
brew install htop

```

Or, if you would rather, go with the even better-looking one called *btop*

```
brew install btop 

```

### tldr

You can use `man` to get help with syntax and other things, but these summaries are often very long and quite complicated to read. To make things easier, you can use `tldr`, which stands for "too long, didn’t read", by installing it with npm:

```
npm install -g tldr

```

This means we can now run `tldr ln` instead:

```
 ln

  Creates links to files and directories.
  More information: https://www.gnu.org/software/coreutils/ln.

  - Create a symbolic link to a file or directory:
	ln -s /path/to/file_or_directory path/to/symlink

  - Overwrite an existing symbolic link to point to a different file:
	ln -sf /path/to/new_file path/to/symlink

  - Create a hard link to a file:
	ln /path/to/file path/to/hardlink

```

Compare that to `man ln` if you can handle it…

### trash

Sometimes, it’s nice for files that you delete to go to the trash first.

In the terminal, `rm` deletes files permanently right away. Not great if it’s a mistake… Add the command `trash` to send files to the trash instead.

```
brew install trash

```

### neofetch

Then everyone benefits from a bit of nice ASCII graphics in their terminal, so remember to install *neofetch* with:

```
brew install neofetch

```

## ➡️ – Restart after changes

Every time you make a change in `.zshrc`, you need to restart the session for the change to take effect.

You can, of course, just close iTerm and start it again, but it’s easier to do `exec zsh` or `source ~/.zshrc`.

## 🅱️ 🅰️ – In summary

Now, finish by pressing 🅱️ and then 🅰️ to complete the Konami code, and the terminal will be significantly nicer the next time you sit down at the computer to get something done.

Epic win! ✌🏻

---

## Resources

- [Mac Setup for Web Development](https://www.robinwieruch.de/mac-setup-web-development/) by Robin Wieruch – an actively maintained fresh-Mac guide
- [macOS Setup Guide](https://sourabhbajaj.com/mac-setup/) by Sourabh Bajaj
- [zoxide](https://github.com/ajeetdsouza/zoxide) – installation and shell setup for the modern `z`
- [Oh My Zsh Plugins wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) – the full catalog of bundled plugins

---

## Metadata

  [\#terminal-treats](/writing/terminal-treats)

 Published .  
 Last modified .

 20 7 47 1347
