Skip to main content

Terminal and OMZ Prompt Setup

terminal

Documenting how I set my terminal up with oh-my-zsh, powerlevel10k theme and plugins. I use Gnomes terminator terminal with tmux.

Pre-requisites

Remove existing install

from terminal: uninstall_oh_my_zsh

Install ZSH

from terminal: sudo apt install zsh

Install oh-my-zsh

visit oh-my-zsh:

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

default ~/.zshrc

I've stripped most of the comments out to leave the active lines

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# theme
ZSH_THEME="robbyrussell"

# Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="true"

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
plugins=(git)

# reload zsh config
source $ZSH/oh-my-zsh.sh

Make oh-my-zsh default shell

Run: $ sudo chsh -s $(which zsh) $(whoami).

Close and re-open your terminal.

Powerlevel10k Theme

Follow instructions here.

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

edit ~/.zshrc, find & change ZSH_THEME to below:

ZSH_THEME="powerlevel10k/powerlevel10k"

reload config with $ source ~/.zshrc

note

After you source your zsrhc file and run through powerlevel10k config, you get a new ~/.p10k.zsh and updated ~/.zshrc.

this gets added to the bottom of your ~/.zshrc file:

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

Plugins

Reference: docs.

Follow these instructions for my plugins setup.

zsh-autocomplete && zsh-autosuggestions

Install both plugins to help with commands autosuggestions suggests possible commands, autocomplete completes the command without needing to press tab to see the full command.

autosuggestions

zsh-autosuggestions: git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

autocompletes

zsh-autocomplete: git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete

Run each command to install plugins.

zsh-syntax-highlighting && fast-syntax-highlighting

  1. zsh-syntax-highlighting: git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
  2. fast-syntax-highlighting: git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting

Run each command to install plugins.

Update your ~/.zshrc with the following line:

plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)

reload config with source ~/.zshrc