Skip to content

Instantly share code, notes, and snippets.

@nhthai2005
Last active April 12, 2024 12:42
Show Gist options
  • Save nhthai2005/f22986522d7e0129dce438bbc110140d to your computer and use it in GitHub Desktop.
Save nhthai2005/f22986522d7e0129dce438bbc110140d to your computer and use it in GitHub Desktop.
How to install Zsh, Oh-my-zsh, powerlevel10k and zsh plugins on Ubuntu

Howto install Zsh, Oh-my-zsh, powerlevel10k and zsh plugins on Ubuntu

Install zsh

sudo apt install zsh -y

Install Oh-my-zsh

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

Download and install necessary fonts

# Download fonts
mkdir -p ~/.fonts && cd ~/.fonts
curl -LO https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
curl -LO https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
curl -LO https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
curl -LO https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

# Install fonts
command fc-cache || sudo apt install fontconfig -y
fc-cache -f -v

Download powerlevel10k theme

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

Download zsh-z zsh-autosuggestions zsh-syntax-highlighting plugin

git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z
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

Set theme and plugins

  • Set ZSH_THEME="powerlevel10k/powerlevel10k" to ~/.zshrc

    sed -i 's|^ZSH_THEME=.*|ZSH_THEME="powerlevel10k/powerlevel10k"|g' ~/.zshrc

  • Set plugins=(git zsh-z zsh-autosuggestions zsh-syntax-highlighting) to ~/.zshrc

    sed -i 's|^plugins=.*|plugins=(git zsh-z zsh-autosuggestions zsh-syntax-highlighting)|g' ~/.zshrc

#!/bin/bash
# Update Oh-my-zsh and the plugins
echo Update Oh-my-zsh
cd ~/.oh-my-zsh
git pull
echo Update powerlevel10k
cd ~/.oh-my-zsh/custom/themes/powerlevel10k
git pull
echo Update zsh-z plugin
cd ~/.oh-my-zsh/custom/plugins/zsh-z
git pull
echo Update zsh-autosuggestions plugin
cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git pull
echo Update zsh-syntax-highlighting plugin
cd ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment