Breno Baptista

Customizing a Terminal With Zsh

Terminal

Table of Contents

1. Zsh

Zsh is an alternative to Bash. Many of the useful features of Bash were incorporated into Zsh, but also many original features were added.

2. Oh My Zsh

Oh My Zsh is a framework for managing your Zsh configuration.

Plugins

To use plugins with Oh My Zsh, you'll need to clone and enable them in your ~/.zshrc file.

plugins=(
  git
  zsh-autosuggestions
  fast-syntax-highlighting
)

3. Change theme or use Spaceship (optional)

You can choose between themes from Oh My Zsh by replacing ZSH_THEME="robbyrussell" in ~/.zshrc or set up your own using Spaceship.

Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt.

Setup

In ~/.zshrc, replace ZSH_THEME="robbyrussell" with ZSH_THEME="spaceship".

Below this line, place this example of customization:

SPACESHIP_PROMPT_ORDER=(
  user      # Username section
  dir       # Current directory section
  git       # Git section (git_branch + git_status)
  exec_time # Execution time
  char      # Prompt character
)
SPACESHIP_USER_SHOW=always
SPACESHIP_PROMPT_SEPARATE_LINE=false

Low-poly portrait of Breno Baptista

Breno Baptista is a software engineer who likes to explore new things every day. He is interested in Linux, open-source software, digital privacy and front-end development.