bosnadev

№ 14 · 2015-02-26 · 3 min · pro-tips

Awesome Looking Terminal With Oh-My-Zsh

My terminal setup on Ubuntu in 2015: Guake, Zsh with Oh-My-Zsh, the agnoster theme with a patched font, and plugins such as artisan completion.

written before the past year · entry 14 of 32 · 11 in the past year

This article is out of date
Written in 2015. Versions, APIs and advice may have changed since.

A lot of people asked me after reading my article A Brief Introduction to Laravel Envoy, how do I get my terminal window to look so awesome. It’s not that hard as it may look like, I keep it simple. Here is what I use:

and of course Ubuntu GNU/Linux.

As a developer, you can increase your productivity by using terminal. But, sometimes people are just too lazy to type long commands over and over again. And it gets even more boring if you repeat same stuff every single day, at the job, at home, everywhere. That’s the primary reason why so many people are so scared of the terminal. But, it does not have to be that way. Few years ago I was so excited when I “discovered” Oh-My-Zsh. And almost instantly I switched Bash with ZSH.

Here are the main reasons why I chose ZSH instead of Bash :

  • incredibly powerful, context based tab completion handling
  • pattern matching on steroids
  • really great community-driven frameworks available

There are two major frameworks available for ZSH , Prezto and Oh-My-Zsh. Personally, I prefer Oh-My-Zsh , but Pretzo have it’s own advantages to.

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 make you shout…

Installing ZSH and Oh-My-Zsh

Installation of ZSH is pretty simple, on Debian/Ubuntu just enter:

terminal1 line
sudo apt-get install zsh

Oh-My-Zsh you can install with curl or wget, so make sure you have them installed:

terminal1 line
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

or with wget :

terminal1 line
wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh

For more detailed installation instruction visit the official page.

Themify Your Promt

Another great thing with Oh-My-Zsh is that you have a ton of useful themes and plugins you can use to customize your prompt. I use agnoster as my default theme. To setup this theme, just download and install one of the patched fonts for Vim-Powerline. For me DejaVuSansMono is good enough. After you have installed patched font, edit ~/.zshrc and set agnoster for theme:

~/.zshrcbash · 5 lines
...ZSH_THEME="agnoster"...

Now, open Guake Preference and set default interpreter to /bin/zsh :

Guake General Propertiesand in the Appearance tab your patched font:

Guake Appearance Preferences

Plugins

You can find full list of plugins here. To enable some plugin, just add it to the list in the ~/.zshrc . For example, if you are a Laravel developer as I am, you want to have Laravel4 and Laravel5 plugins enabled:

~/.zshrcbash · 6 lines
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/# Example format: plugins=(rails git textmate ruby lighthouse)# Add wisely, as too many plugins slow down shell startup.plugins=(git rvm rails laravel5 laravel4)

You’ll now have php artisan completion, which is pretty cool:

PHP Artisan AutocompleteAs I mentioned, you can use plugins for many other tools, for example: bower, capistrano, docker, heroku and so on.

That’s it for now. I recommend you to make the switch right now. You’ll make no regret. Play around with configuration, plugins, themes. Share your configuration or tips how to make it better.

Related

Pro tip: How to repair an Ubuntu system with a Live CDpro-tipsPro tip: Display all validation errors in Blade Viewpro-tipsSSH Authentication With Keys Instead Passwordsserver