ZSH Guide

ยท 378 words ยท 2 minute read

One of the core elements of a developers, operations, and security engineers system is having a powerful shell. This video is a guide on how to install, configure, and customize ZSH to make it beautiful and making your life easier when using your shell.

Video Guide ๐Ÿ”—

Installing ZSH ๐Ÿ”—

Lets get started by installing ZSH on our system.

Its very easy to install on almost every operating system as zshell is pretty much available from most package managers on Linux and MacOS:

# Debian / Ubuntu
apt install zsh

# Arch / Manjaro
pacman -S zsh

# MacOS
brew install zsh

The other tool we will be install is Oh My ZSH which is an open source framework for managing your ZSH configurations.

We can simply run a curl command to install Oh My ZSH:

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

The two main reasons for installing Oh My ZSH is the themes and plugins available to us which weโ€™ll cover later.

Configuration and Customization ๐Ÿ”—

Themes ๐Ÿ”—

You can see a list of all the default themes built into Oh My ZSH.

~/.zshrc

# ZSH_THEME="robbyrussell"
# ZSH_THEME="fino"
ZSH_THEME="agnoster"

Plugins ๐Ÿ”—

You can find a list of all the default plugins built into Oh My ZSH.

~/.zshrc


# https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
plugins=(
    # Tools 
	git
    docker
    kubectl
    tmux

	# OS
	debian
    macos

    # Programming Languages
	rust
    python

	# Misc
    colored-man-pages
	web-search
)

Tips && Tricks ๐Ÿ”—

Here is a bunch of tips and tricks that I think is useful to know.

Default Shell ๐Ÿ”—

If you want to run ZSH as your default shell on your system, you need to run the change shell command to set it for your user.

# Run Change Shell tool
chsh -s $(which zsh)

Using Dotfiles Repositpory ๐Ÿ”—

Check out my guide to using dotfiles

Adding Custom Aliases and Functions ๐Ÿ”—

Take a look at some of my bash scripts in my dotfiles GitHub repositpory.

https://github.com/GeekMasher/.dotfiles/tree/main/geek/.geek

Additional Plugins ๐Ÿ”—

You can also install additional plugins in ZSH that are outside of the default plugins.

Here are some of those that I think are worth bringing up:

# https://github.com/zsh-users

plugins=(
    # https://github.com/zsh-users/zsh-autosuggestions
    zsh-autosuggestions
    # https://github.com/zsh-users/zsh-syntax-highlighting
    zsh-syntax-highlighting
)

Neofetch ๐Ÿ”—

# Run neofetch if present on machine
if [ -x "$(command -v neofetch)" ]; then
    neofetch
fi

Resources ๐Ÿ”—