Amit K Biswas
Back to blog

Terminal setup for the impatient

6 min read

Setting up a modern terminal workflow can be daunting, but at the same time quite rewarding and helpful once you get the hang of it. In this post, I’ll share the steps I usually follow to set up a new terminal, and the settings and plugins I use which feels useful and manageable to me. The commands will be for Ubuntu as that’s the one I use, but should be easily reproducible in other distros as well. Let’s dive in!

Installing zsh

The first step to a good terminal experience is to ditch bash and install zsh (or fish if that’s your choice). Zsh is available for installing on most of the linux distros and is the default shell for recent macOS versions. To install and set as default –

sudo apt install zsh && chsh -s $(which zsh)

You can check the current shell with echo $0. For in-depth instructions to install zsh, refer to the link here. After the installation and setup are done, log out and log back in to apply the new shell changes. During initialization, a prompt will ask if we want to create a .zshrc file for the config. Enter 2 to populate the it automatically. The shell will look like this,

After installing zsh

Installing Oh My Zsh

Oh My Zsh is an open-source framework for managing your zsh configuration. Make sure you have git, curl, and of course, zsh properly installed beforehand, and then run this command,

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

As we can see in the following screenshot, the shell already changed after installing omz.

After installing omz

Installing Plugin

zsh has hundreds of useful plugins, serving various user needs. I use only three, and they’ve proven to be quite handy in my experience.

Installing a shell prompt

A good shell prompt is not only essential for an aesthetic look but also for usability purposes. Apps like Starship do this quite nicely, but I use Powerlevel10k because it has a great configuration wizard, supports many utilities out of the box, arguably much faster than its competitors, and lastly, easy to install. Installation instructions along with the recommended font support can be found on their official repository. My personal config is a bit minimal and doesn’t use many fancy icons and features.

After installing powerlevel10k

Installing Alacritty

Most Unix-based distros come with their flavor of the terminal emulator app, i.e. Terminal in macOS, gnome-terminal in Ubuntu, Terminator in Manjaro, and so on. I’ve been using Alacritty for a while now, it’s a blazingly fast terminal emulator app written in Rust with tons of customization options. Let’s set it up.

# makes config change effects instant
live_config_reload: true
# styles for the window
window:
  dimensions:
    columns: 120
    lines: 36
  opacity: 0.98
  padding:
    x: 12
    y: 10
  dynamic_padding: false
  decoration: none
  decorations_theme_variant: Dark
# font setup for the terminal
# use Nerd font for better unicode support.
# https://www.nerdfonts.com/font-downloads
font:
  normal:
    family: "MesloLGS NF"
    style: Regular
  size: 12
# cursor styles
cursor:
  style:
    shape: Beam
    blinking: On
# some utilites
save_to_clipboard: true
draw_bold_text_with_bright_colors: true

After installing alacritty

Bonus Tip for Ubuntu Gnome

In Ubuntu gnome (the default Ubuntu variant), Ctrl + Alt + T opens the default terminal. If you want to change the default terminal to Alacritty,

Change ubuntu keyboard shortcut

Final words

Phew! Lots of installing and searching and whatnot! But if everything went correctly, you should be presented with a nice-looking shell prompt inside the alacritty terminal emulator, which has autocompletion, syntax highlighting, and looks a bit nerdy!