Continuing with zsh journey

  • zsh
Zsh
Adding Powerline and command syntax highlighting

In the previous post, I wrote about switching over to Zsh and adding my own Zsh theme. Since then, I've added a new theme to my Oh My Zsh fork that uses Powerline. Here are some extra bits to my Zsh config.

Installing Powerline Fonts

For Mac:

git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh

For Ubuntu:

sudo apt install powerline fonts-powerline

Note: be sure to actually select one of these fonts in the terminal you are using.

Installing Oh My Zsh

REPO=tkanemoto/ohmyzsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Using 256-colour in tmux

By default, tmux sets TERM to screen so that needs to be configured to use 256-colour in .tmux.conf, independent of your terminal's configuration:

set -g default-terminal "screen-256color"

Syntax-highlighting

Clone the zsh Syntax Highlighting repo:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1

Source the Syntax Highlighting repo's source script in .zshrc

echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"

Adding stuff to PATH in Zsh

This is pretty straight-forward. Same syntax as Bash but in .zshrc instead:

echo 'export PATH=$PATH:~/Library/Python/3.8/bin' >> "$HOME/.zshrc"

Result

Screenshot 2021-01-27 at 14.42.11.png