zsh & Shell setup

Table of contents
  1. Install zsh
    1. OS X
    2. Ubuntu
  2. Change to zsh
  3. Install oh-my-zsh
  4. Change Theme
  5. Recommended plugins
    1. zsh-syntax-highlighting
    2. zsh-autosuggestions
    3. fzf
    4. z
    5. fasd
  6. Preferred Iterm2/Gnome Terminal color schemes

Install zsh

OS X

brew install zsh

Ubuntu

sudo apt install zsh

Change to zsh

Make zsh the default shell

chsh -s $(which zsh)

Confirm shell has changed

echo $SHELL

In Ubuntu, if echo $SHELL or echo $0 still shows bash, try logging out and log back in. Hopefully, shell would have been changed and zsh-newuser-install will pop up.


Install oh-my-zsh

Assuming you have curl installed,

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

In case of a change refer to here for a new link.


Change Theme

My preferred theme is Powerlevel10k.

To install it as an Oh My Zsh theme,

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

Then in ~/.zshrc, set ZSH_THEME

ZSH_THEME="powerlevel10k/powerlevel10k"

When using Iterm2, the recommended fonts are automatically installed. Otherwise, install the fonts from here.


zsh-syntax-highlighting

See here for details.

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

To activate the plugin, go to .zshrc and add zsh-syntax-highlighting to plugins.

zsh-autosuggestions

See here for details.

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

To activate the plugin, go to .zshrc and add zsh-autosuggestions to plugins.

fzf

See here for details.

# OS X
brew install fzf
# Ubuntu
sudo apt install fzf

Then activate the plugin in .zshrc.

z

Feature that was included in fasd.

Simply add z to oh-my-zsh plugins in .zshrc.

fasd

DEPRECATED

See here for details.

# OS X
brew install fasd
# Ubuntu
sudo apt install fasd

Then activate the plugin in .zshrc.


Preferred Iterm2/Gnome Terminal color schemes

Look for the following themes in Iterm2 / Gough:

  • Snazzy
  • Tomorrow Night