Skip to content

Guide - Setup oh-my-zsh

Contents

Pre-Requisites

  1. Install a nerd-font - Follow the linked instructions to install the Meslo Nerd Font.
  2. Apply the nerd-font to your defauly terminal, shells, and editors:
  3. Windows Terminal: Open Settings (Ctrl+,), search for fontFace and set value to the installed NF nerd font (i.e. “MesloLGS NF”) for every profile and the default profile.
  4. VSCode: Open File → Preferences → Settings, enter terminal.integrated.fontFamily in the search box and set the value to to the installed NF nerd font (i.e. “MesloLGS NF”)
  5. Windows Console Host: Click the icon in the top left corner, then Properties → Font and set Font to “MesloLGS NF”
  6. Jupyter Lab Terminal: Settings: Advanced Settings Editor → Terminal, then enter the below in the User Preferences window
  7. Install zsh Shell: sudo apt-get -y install zsh

Set Default Shell

Start by setting ZSH as the default shell instead of BASH: chsh -s $(which zsh)

chsh -s $(which zsh)

Install Oh-My-Zsh

To “install” (really just cloning a git repo) oh-my-zsh simple execute the shell command below:

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

Validate by running:

omz --version

Install oh-my-zsh Plugins

To install manually simply, clone these plugins to the default ZSH_CUSTOM/plugins folder:

install_omz_plugin() {

}

git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions;
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions;
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting;
git clone https://github.com/supercrabtree/k ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/k;

Run the commands below to install some useful plugins and the powerlevel10k theme:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k;

Now use VSCode, or another text editor, to make a few changes to the .zshrc file. For example, if you have VSCode installed you can use it from a macOS or Windows Terminal by typing:

code ~/.zshrc

Replace the plugins section in the .zshrc file with the code below

plugins=(
  git
  zsh-completions
  zsh-autosuggestions
  zsh-syntax-highlighting
  k
)

Then replace ZSH_THEME="robbyrussell" with ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc. Save the changes and type source ~/.zshrc in the terminal to start the configuration wizard. Follow the prompts and select the setup you prefer. You can always update and change the configuration by running p10k configure in a terminal.


See Also: