Setting Up Zsh on Your PC or VPS

May 12, 2023 (2y ago)

Setting Up Zsh on Your PC or VPS

Zsh (Z shell) is a powerful shell with improved features over bash, including better tab completion, spelling correction, and customizable prompts. Here's how to set it up:

Installation

Linux

# Ubuntu/Debian
sudo apt install zsh
 
# CentOS/RHEL
sudo yum install zsh
 
# Arch Linux
sudo pacman -S zsh

macOS

macOS ships with Zsh by default since Catalina. For older versions:

brew install zsh

Windows

Install Windows Subsystem for Linux (WSL) and then install Zsh in your Linux distribution.

Making Zsh Your Default Shell

chsh -s $(which zsh)

Installing Oh My Zsh

Oh My Zsh provides themes and plugins to enhance Zsh:

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

Configuration

Edit ~/.zshrc to customize your setup:

Must-Have Plugins

FZF Setup

macOS

brew install fzf

Linux

sudo apt install fzf

Windows

Install through WSL.

sudo apt install fzf

VPS-Specific Setup

Final Touch

Restart your terminal or run source ~/.zshrc to apply changes.

With this setup, you'll have a powerful and customized terminal experience that will significantly improve your productivity when working on your PC or VPS.