Skip to content

Instantly share code, notes, and snippets.

@fullmetalbrackets
Last active December 21, 2024 20:09
Show Gist options
  • Save fullmetalbrackets/fce72e8f20e68d3b13ab0ae2d036e998 to your computer and use it in GitHub Desktop.
Save fullmetalbrackets/fce72e8f20e68d3b13ab0ae2d036e998 to your computer and use it in GitHub Desktop.
Quick Guide - install zsh + oh-my-zsh w/ plugins & powerlevel10k theme

Install Zsh

sudo apt install zsh -y

Install oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Install some plugins

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

Enable plugins

omz plugin enable \
git \
z \
dirhistory \
colorize \
colored-man-pages \
sudo \
zsh-syntax-highlighting \
zsh-autosuggestions \
zsh-completions

Prep for theme - install nerd fonts

wget -O /usr/share/fonts/MesloLGS%20NF%20Regular.ttf https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
wget -O /usr/share/fonts/MesloLGS%20NF%20Bold.ttf https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
wget -O /usr/share/fonts/MesloLGS%20NF%20Italic.ttf https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
wget -O /usr/share/fonts/MesloLGS%20NF%20Bold%20Italic.ttf https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

Alternately, use this bash script to install the fonts in one go:

sudo sh -c "$(curl -fsSL https://gist.githubusercontent.com/fullmetalbrackets/5a094e7daef47dd63074259143466442/raw/86f1cb332dda8976fddd371d3cf2530e48e031c9/meslo-fonts.sh)"

Install powerlevel10k theme

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

Using Zsh

Oh-My-Zsh install should have prompted to make Zsh the default shell. Logout and back in to use Zsh and initialize Oh-My-Zsh.

Configure theme

p10k configure

Done!

All your configuration will be saved in a .zshrc file in the user directory. Backup this file and in the future you can replicate this process with less steps, since your plugins and theme will already be preset -- just install Zsh, Oh-My-Zsh and the nerd fonts. (If using Powerlevel10k or another theme that requires them.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment