Install and use Oh My Zsh(ell)

Why?

Simply to have a better visibility working trough repositories with Git statements.

The Z shell has become one of the most popular shells for Linux operating system. It’s rich in features and easy to configure and customize. Following are some key zsh features:

  • Command auto-complete
  • Improved variable handling
  • Spelling correction
  • Shared command history
  • Kill tab completion
  • Environment variable easy setup
  • Customizable

retrieved from https://www.howtoforge.com/tutorial/how-to-setup-zsh-and-oh-my-zsh-on-linux/

Install zsh

Gorgeous tutorial from A to Z on: http://www.tricksofthetrades.net/2015/02/05/zsh-basic-configuration/

Here are the steps to have quickly an ``Oh My Zsh`` working configuration

First install Zsh with the following command line:

sudo apt-get install zsh

Make it as your default shell interface:

chsh -s $(which zsh)

Control your profile was affected by changes:

cat /etc/passwd

Your username should look like this:

matbgn:x:1000:1000:Matthieu Borgognon,,,:/home/matbgn:/usr/bin/zsh

Log out and log in

Simply completly log out from your actual session and log in, without it it won’t work at all!

New terminal

By opening a new terminal (CTRL+ALT+T), you will have a special prompt, nor test that it worked with echo $SHELL. Expected result: /bin/zsh or similar.

By the prompt select the option to populate the ~/.zshrc with the recommanded admin config. Fit all question as this (for more details go to http://www.tricksofthetrades.net/2015/02/05/zsh-basic-configuration/):

zShellConfigurationFunctionForNewUser

If it doesn’t run or drop into the config then simply type:

zsh /usr/share/zsh/functions/Newuser/zsh-newuser-install -f

Then install the framework Oh My Zsh with the following command:

curl -L http://install.ohmyz.sh | sh
ohMyZshInstallation

To get a nice and fresh theme I strongly recommend to use Agnoster instead of robbyrussell’s one by editing nano ~/.zshrc:

nanoZshrc

Last but not least on Ubuntu install to avoid special characters problems:

sudo apt-get install fonts-powerline

On other system :

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts

For Windows Subsystem for Linux (WSL) simply install this font from my Github repository: https://github.com/matbgn/powerline-consolas/raw/master/consola.ttf

For a friendly and helpful look:

agnosterDeploymentResult

Enjoy with your new terminal!