My Terminal Setup

Zsh

My favorite shell so far is Zsh. To install it:

sudo apt install zsh

and set as default:

chsh -s $(which zsh)

When opening the terminal it'll ask for some configurations, I don't do anything and just quit by pressing 0.

Oh My Zsh

Oh My Zsh is a framework on top of Zsh, it enables themes and several functionalities. The install instructions are in the homepage. After installing it looks like this, which to me is ugly:

Fresh terminal

Theme

To make it look better I change the theme and color scheme. My favorite theme is spaceship. To install follow the oh my zsh instructions on their GitHub. I also use Dracula color schema for everyhing, the terminal is no different. It already looks better:

Themed terminal

Plugins

A complete list is available here. I use these:

zsh-autosuggestions

It suggest commands as I type based on history and completions. Then I can simple press he right arrow key if it's the righ command.

Fresh terminal

Autojump

It's a faster way to move around. It maintains a local database of the most used directories used from the command line. When doing j whatever it searches this database for the first entry that contains whatever and navigate to there.

Example of how autojump looks like

zsh-syntax-highlighting

Syntax highlight, which helps catching typo before running the command. Look how echo and "Hello" have different colors:

Example of how syntax highlight looks like

fzf-zsh-plugin/fzf-tab

fzf is a fuzzy finder for the command line. By combining both these plugins I can do things like this:

Example of how fzf works

Shortcuts

These are the shortcuts I use because I got used to them and for me they feel intuitive. This is not an absolute list! For instance, I could delete to the beginning of the current word by using Ctrl+w, but prefer to use Alt+backspace.

Moving on the current line

Key bindingsDescription
Ctrl+amove cursor to beginning of line
Ctrl+emove cursor to end of line
Ctrl+left arrowmove one word to the left
Ctrl+right arrowmove one word to the right
Example of how to move on the terminal

Moving between previous commands

Key bindingsDescription
arrow up/downnavigate in the history of commands
Ctrl+rmove cursor to end of line

Deleting

Key bindingsDescription
Alt+backspacedelete up until the beginning of the current word
Ctrl+kdelete everything after the cursor
Ctrl+udelete everything

Exiting

Key bindingsDescription
Ctrl+cinterrupt the current running process
Ctrl+dexit the session (closes the terminal)