Skip to content

Instantly share code, notes, and snippets.

@elkuno213
Last active January 28, 2026 17:34
Show Gist options
  • Select an option

  • Save elkuno213/fe0d401310134bb6012beb3627c367ee to your computer and use it in GitHub Desktop.

Select an option

Save elkuno213/fe0d401310134bb6012beb3627c367ee to your computer and use it in GitHub Desktop.
Install zsh and oh-my-zsh via script

Zsh Installation Script

This script installs Zsh with Oh-My-Zsh, sets up a theme, and enables plugins.

Features

  • Installs Zsh with Oh-My-Zsh
  • Sets up the gnzh theme
  • Enables git, zsh-autosuggestions, and zsh-syntax-highlighting plugins
  • Changes default shell to Zsh

Installation

To install, run the following command:

# Install zsh
sudo apt update && sudo apt install -y zsh git wget

# Install Oh My Zsh (unattended)
sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

# Install custom plugins
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-completions         ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# Configure .zshrc (theme and plugins)
sed -i 's/ZSH_THEME=".*"/ZSH_THEME="gnzh"/'                                                        ~/.zshrc
sed -i 's/plugins=(.*)/plugins=(git zsh-autosuggestions zsh-completions zsh-syntax-highlighting)/' ~/.zshrc

# Set zsh as default shell
chsh -s $(which zsh)

Requirements

  • zsh,git, and wget must be installed
  • Root privileges for changing default shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment