Skip to content

Instantly share code, notes, and snippets.

@AbdoCooder
Last active January 9, 2026 15:26
Show Gist options
  • Select an option

  • Save AbdoCooder/d8578841deccfb33258c67fff3f164a9 to your computer and use it in GitHub Desktop.

Select an option

Save AbdoCooder/d8578841deccfb33258c67fff3f164a9 to your computer and use it in GitHub Desktop.
Setup oh-my-zsh with all the advanced features

Oh My Zsh + Powerlevel10k Setup Guide πŸš€

0. Using a script

> USE THE SCRIPT TO AUTOMATICALLY INSTALL AND CONFIGURE THIS ENV, IF NOT WORKING THERE IS A MANUAL GUIDE DOWN.

TO RUN THE SCRIPT:

  • DOWNLOAD IT
  • chmod +x install.sh
  • bash install.sh

This guide helps you install Zsh, Oh My Zsh, Powerlevel10k, and some very useful Zsh plugins to supercharge your terminal on Ubuntu / Debian-based systems.


1. Install Zsh

sudo apt install zsh -y

Make Zsh your default shell:

chsh -s $(which zsh)

Start Zsh:

zsh

2. Install Oh My Zsh

Run the official installer:

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

3. Install Powerlevel10k Theme

Clone the theme into Oh My Zsh custom themes directory:

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

Edit your Zsh configuration file:

nano ~/.zshrc

Replace the theme line with:

ZSH_THEME="powerlevel10k/powerlevel10k"

Apply changes:

source ~/.zshrc

Run the configuration wizard:

p10k configure

πŸ‘‰ Follow the prompts to customize your prompt.


4. Fonts (IMPORTANT ⚠️)

If icons or symbols look broken, install Meslo Nerd Font:


5. Install Useful Zsh Plugins

Autosuggestions

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

Syntax Highlighting

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

Autocomplete

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

6. Enable Plugins

Edit your .zshrc again:

nano ~/.zshrc

Replace the plugins line with:

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

Reload configuration:

source ~/.zshrc

βœ… Done!

You now have: - Zsh as your default shell - Oh My Zsh framework - Powerlevel10k theme - Autosuggestions, syntax highlighting & autocomplete

Enjoy your new terminal ✨

#!/usr/bin/env bash
set -e
echo "πŸš€ Universal Oh My Zsh installer (apt / dnf / pacman)"
# Detect package manager
if command -v apt >/dev/null 2>&1; then
PKG="apt"
elif command -v dnf >/dev/null 2>&1; then
PKG="dnf"
elif command -v pacman >/dev/null 2>&1; then
PKG="pacman"
else
echo "❌ Unsupported package manager"
exit 1
fi
echo "πŸ“¦ Detected package manager: $PKG"
# Install dependencies
case "$PKG" in
apt)
sudo apt update
sudo apt install -y zsh git curl fonts-powerline
;;
dnf)
sudo dnf install -y zsh git curl util-linux-user powerline-fonts
;;
pacman)
sudo pacman -Sy --noconfirm zsh git curl powerline-fonts
;;
esac
# Set Zsh as default shell
if [ "$SHELL" != "$(which zsh)" ]; then
echo "πŸ” Setting Zsh as default shell"
chsh -s "$(which zsh)"
fi
# Backup existing .zshrc
if [ -f "$HOME/.zshrc" ]; then
cp "$HOME/.zshrc" "$HOME/.zshrc.backup.$(date +%s)"
echo "🧠 Existing .zshrc backed up"
fi
# Install Oh My Zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo "πŸ“¦ Installing Oh My Zsh"
RUNZSH=no CHSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
ZSH_CUSTOM=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
# Install Powerlevel10k
if [ ! -d "$ZSH_CUSTOM/themes/powerlevel10k" ]; then
echo "🎨 Installing Powerlevel10k"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$ZSH_CUSTOM/themes/powerlevel10k"
fi
# Install plugins
echo "πŸ”Œ Installing plugins"
[ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ] && \
git clone https://github.com/zsh-users/zsh-autosuggestions.git "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
[ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ] && \
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
[ ! -d "$ZSH_CUSTOM/plugins/zsh-autocomplete" ] && \
git clone --depth 1 https://github.com/marlonrichert/zsh-autocomplete.git "$ZSH_CUSTOM/plugins/zsh-autocomplete"
# Configure .zshrc
echo "βš™οΈ Configuring .zshrc"
sed -i 's/^ZSH_THEME=.*/ZSH_THEME="powerlevel10k\\/powerlevel10k"/' ~/.zshrc || true
sed -i 's/^plugins=.*/plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-autocomplete)/' ~/.zshrc || true
echo ""
echo "βœ… All done!"
echo "πŸ‘‰ Restart terminal or run: zsh"
echo "πŸ‘‰ Then run: p10k configure"
echo "πŸ‘‰ Install Meslo Nerd Font if icons look broken"
@AbdoCooder
Copy link
Author

🀝 Contributing

Contributions are very welcome!
This project aims to provide a simple, portable, and developer-friendly script to install Oh My Zsh and related tools across multiple Linux distributions. Any improvements, fixes, or ideas from the community are greatly appreciated.


How to Contribute

  1. Fork the repository

  2. Create a new branch for your change:

    git checkout -b feature/your-feature-name
  3. Make your changes

    • Keep the script idempotent (safe to run multiple times)
    • Prefer portable Bash and avoid distro-specific hacks when possible
    • Do not hard-code paths or user-specific values
  4. Test your changes

    • Test on at least one supported package manager (apt, dnf, or pacman)
    • Ensure the script fails clearly and safely when something goes wrong
  5. Commit with a clear message

    git commit -m "Improve XYZ / Add ABC support"
  6. Open a Pull Request

    • Clearly describe what you changed and why
    • Mention the distribution(s) you tested on

What You Can Improve

Some ideas (but not limited to):

  • Support for additional package managers (e.g. brew, zypper)
  • Optional flags (e.g. --no-fonts, --no-theme, --plugins-only)
  • Better font installation or detection
  • Improved error handling and logging
  • Script performance or cleanup improvements
  • Documentation and README enhancements

Code Style Guidelines

  • Use set -e and meaningful echo messages
  • Prefer readability over clever one-liners
  • Keep dependencies minimal
  • Comment non-obvious or critical logic

Thank you for contributing ❀️
Happy hacking!

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