Table of Contents

Ubuntu Install Oh-My-Zsh

In order to use “Oh My Zsh” you will need to have the zsh shell installed and enabled as your default shell.

Installing Zsh

apt install zsh

Determine the path for zsh

which zsh

Next change your shell to zsh assuming here that the path we got above was /usr/bin/zsh

chsh -s /usr/bin/zsh

Now log out and into your system again for changes to take effect.

Unlike other shells zsh comes with a configuration menu the first time you launch it. Select the following.

1: Continue to main menu
1: Again configure settings for history. And here press 1 2 and 3

Press “0” remember the changes, and once back on the main menu and here press “0” again to save the configuration.

Installing Oh-My-Zsh

Oh My Zsh can be installed using either curl or wget

Install Using Curl

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install Using Wget

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Tweaks

I suggest adding a few plugins.

vi .zshrc

Find this line:

plugins=(

And add the following plugins.

git
ruby
gem
colored-man-pages

All plugins listed on the plugins Github page are pre-installed with Oh-My-Zsh at ~/.oh-my-zsh/plugins. Custom plugins can be installed at ~/.oh-my-zsh/custom/plugins. To use a plugin, you can simply add it to the plugins list in your ~/.zshrc file. Add wisely, as too many plugins slow down shell startup. Leave a blank between each plugin.

Pro Tip: Another great plugin is syntax highlighting and zsh-autosuggestions theese plugins are not preinstalled with Oh-My-Zsh.

Installing Syntax Highlighting

cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting

Installing Zsh Autosuggestions

cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions

Then enable the pluings by adding them to the .zshrc file.

vi .zshrc

Find this line:

plugins=(

And add the following plugins.

zsh-syntax-highlighting
zsh-autosuggestions

Changing The Prompt

For this we are going to use the default theme which is called “robbyrussell.zsh-theme”

vi ~/.oh-my-zsh/themes/robbyrussell.zsh-theme

We are looking to change the first line. Look for %c and change it to either:

Running The Configuration Again

Once you done the initial configuration you will not be asked again. You can however run it manual like this.

autoload -Uz zsh-newuser-install
zsh-newuser-install -f

Unistalling Zsh

Remove zsh
sudo apt --purge remove zsh
chsh -s $(which "bash")