zsh - the better bash

Install zsh via the package manager of your OS/distribution.

sudo apt update && sudo apt install -y zsh

Then set zsh as your default shell.

# for your user
chsh -s $(which zsh)
 
# for the root user
sudo chsh -s $(which zsh)

Configure completion by running compinstall. You will be guided through the configuration process.

autoload -Uz compinstall
compinstall

To use the full potential of zsh, you should also install the oh-my-zsh framework as well as some packages to optimize the efficiency of your work flow.

# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
 
# install fuzzy finder for fault resistant autocompletion
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
 
# clone the zsh autosuggestions plugin for fish-like autocompletion
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
 

Configuration

Configuration is done in the .zshrc file. This file can become very large, so you can split it into multiple files located in the $ZSH_CUSTOM directory.

$ZSH_CUSTOM/completions.zsh

# fuzzy finder (installed via git clone from https://github.com/junegunn/fzf)
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# helm
source <(helm completion zsh)
# kubectl
source <(kubectl completion zsh)

$ZSH_CUSTOM/extended_history.zsh

export SAVEHIST=1000000000
export HISTSIZE=1000000000
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY