Bash (Bourne Again Shell) is the default command-line shell on many distributions. Zsh (Z Shell) is a powerful shell that operates as both an interactive shell and as a scripting language interpreter.
sudo apt install zsh
sudo dnf install zsh
sudo pacman -S zsh
For basic configuration run the following command:
zsh /usr/share/zsh/functions/Newuser/zsh-newuser-install -f
Follow the recommended options, save and exit.
Now, let’s install a powerful additional program.
zsh
, curl
and git
should be installed first.
- Ubuntu/Mint:
sudo apt install curl git
- Fedora:
sudo dnf install curl git
- Manjaro/Arch:
sudo pacman -S curl git
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
I recommend installing 6 additional plugins that we’ll activate later through OMZ configuration file
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
For advanced configuration, modify the ~./zshrc
config file.
Follow this instraction for Configuring zsh:
- Open
~./zshrc
file.
nano ~/.zshrc
- Find the line which says
plugins=(git)
. Replace that line with:
plugins=(
fzf
git
sudo
history-substring-search
colored-man-pages
zsh-autosuggestions
zsh-syntax-highlighting
fast-syntax-highlighting
zsh-autocomplete
zsh-z
)
- Find the
ZSH_THEME="robbyrussell"
Replace withZSH_THEME="gnzh"
source ~/.zshrc
chsh -s $(which zsh)
If you need more minimal, blazing-fast, and infinitely customizable prompt for any shell! You can use Starship.
- Fast: it's fast – really really fast! 🚀
- Customizable: configure every aspect of your prompt.
- Universal: works on any shell, on any operating system.
- Intelligent: shows relevant information at a glance.
- Feature-rich: support for all your favorite tools.
- Easy: quick to install – start using it in minutes.
You can visit my Starship Documentation.
Enjoy!