Installing ohmyzsh on Debian based Linux

written at: 2024-07-22

Ohmyzsh is an addon for your zsh based terminal. It makes a lot of things a great deal easier such as command auto completion, being able to see which branch you are working, but there is a lot more where that came from. The full documentation is located here: documentation

Although setting up ohmyzsh is pretty straightforward, i found out that using some themes (for example agnoster) require some extra steps. It is missing some font files for proper functioning. Below code is assuming you already use the zsh terminal. If you do not know which one you are using (bash/zsh), you can type below command to find out:

echo $0

If that does not work, just type a random word, the first output will show your terminal. For example:

randomstring

If the output is 'bash:', read here how to switch to zsh.

To install using curl:

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

To install using wget:

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

Then open up your profile's .zsh file in your favourite editor:

vi ~/.zshrc

Replace the ZSH_THEME entry with this one:

ZSH_THEME="agnoster"

If you open up a new terminal, you'll notice some strange characters in the prompt. This is due to missing font files. To install them, there is a ready made solution. First go to a folder to download a git repository, for example: 'cd ~/Downloads'.

The copy and paste this command:

git clone https://github.com/powerline/fonts.git

Then:

cd fonts

And finally:

./install.sh

After you are done, you can remove the fonts directory from your Downloads directory to clean up. Go to the settings of your terminal application and choose any font you like, as long as it has 'Powerline' in it. These fonts contain the proper characters to display the right content in this zsh theme. Enjoy!