DEV Community

Gift Egwuenu
Gift Egwuenu

Posted on

Quick Setup of Oh My ZSH! terminal on Ubuntu

Tired of the good ol' boring looking terminal? Do you want to try something different and funky then you should definitely try Oh-my-zsh! As developers, we can't deny the fact that the Command line terminal is part of our existence.

banner

Oh-My-Zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that will make you shout.

Prerequisites

* Disclaimer: Oh My Zsh works best on macOS and Linux.

  • Unix-like operating system (macOS or Linux)

  • Zsh should be installed (v4.3.9 or more recent). sudo apt-get install zsh If not pre-installed (zsh --version to confirm), curl or wget should be installed

  • git should be installed

Installation

Via wget


$ sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Enter fullscreen mode Exit fullscreen mode

Via curl


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

Enter fullscreen mode Exit fullscreen mode

Now we have zsh and oh-my-zsh installed next step is to go ahead with configuration.

THEMES

Oh-My-Zsh comes bundled with several themes located in ~/.zshrc/themes which can be enabled by adding the name of the theme in the ~/.zshrc file.

# nano ~/.zshrc
# This can be changed to whatever theme is preferred
ZSH_THEME="agnoster"
Enter fullscreen mode Exit fullscreen mode

agnoster

PLUGINS

Oh-my-zsh also includes a handful of plugins available to help make development faster and easier. One of my best is the fact that auto-completion works out of the box. You would not need to type a whole command just hitting tab helps by suggesting possible command related to your needs.

Another awesome thing to try is the zsh-syntax-highlighting This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.

Tip 💡

You can easily switch between bash and zsh by running this command

# switching from zsh to bash
exec bash
Enter fullscreen mode Exit fullscreen mode
# switching from bash to zsh
exec zsh
Enter fullscreen mode Exit fullscreen mode

There you go, I hope after reading this you switch from whatever shell you were using to zsh and also try out oh-my-zsh they are both awesome.🚀

Feel free to share your comments and thoughts.

Originally posted at giftegwuenu.com

Top comments (9)

Collapse
 
dimitri_acosta profile image
Dimitri Acosta

If you're using agnoster as a theme then you should install one of the patched fonts from Vim-Powerline for special characters.

Also, if you don't want to see your username at the begining of the prompt (as I would recommend) then you'll have to add this to your ~/.zshrc file

...
DEFAULT_USER="your_username"
prompt_context(){}
...

This will hide the user@hostname info

Collapse
 
lauragift21 profile image
Gift Egwuenu

Thanks for the tip this is helpful.

Collapse
 
judecodes profile image
Cool

Hey I have a question as of now I had change the theme on zshrc file but however the theme on my command line is still the same. But Looking at my terminal in VS CODE it did however Change.

I was wondering to change the default theme?

Collapse
 
itsasine profile image
ItsASine (Kayla)

I feel like I never properly utilize oh-my-zsh.

It's prettier than Terminal! But I never remember to use the autocompletes, including the add-on stuff like git and docker that I enabled. I just use it as a reskinnedTerminal.

Collapse
 
vschoener profile image
Vincent Schoener

Take a loot to Prezto, oh-my-zsh is slower because it uses zsh wrapper instead of native code.
(Maybe things have changed since the time I switched for prezto)

Collapse
 
chiangs profile image
Stephen Chiang

Cool, another zsh user! I recently posted about article as well on it: bling-ified terminal

Collapse
 
lauragift21 profile image
Gift Egwuenu

Yay, it's super cool!

Collapse
 
danechitoaie profile image
daniels

I use zsh but with Prezto.

Collapse
 
cleiton55048426 profile image
Cleiton

I use omz with powerlevel9k in my Tilix Terminal and together they are awesome.