· Linux tutorial - 5 min read

Have a geeky terminal environment with ZSH

Working with the normal terminal on Linux is difficult. For example, you don't have any suggestions while you writing commands. In this tutorial, we will change the normal terminal with zsh and some of its must-have plugins. I assure you after working with these tools, you always want to change any normal terminal you see.

Have a geeky terminal environment with ZSH

What is Zsh?

What is Zsh?

Zsh is a Unix shell used for command-line interpreting. It’s an alternative to the standard bash shell. One of the key features of Zsh is its advanced completion system, which can automatically complete commands, options, and filenames based on context and history. Zsh also provides a powerful syntax-highlighting feature that can highlight commands and arguments as you type them. Zsh is highly configurable and can be customized with many plugins and themes. It is often used as an alternative to the default shell on Unix-based systems, such as Bash or the Bourne shell.

Installing Zsh

Installing Zsh

1. Install zsh package

1. Install zsh package

Verify zsh installation with zsh --version , you must see something like zsh 5.8.1

2. Change default shell to zsh

2. Change default shell to zsh

3. Verify change

3. Verify change

Plugins

Plugins

Installing OH My Zsh

Installing OH My Zsh

Source 1

Installing AutoSuggestion

Installing AutoSuggestion

Need oh my zsh to be installed.

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

add to .zshrc :

plugins=(
    # other plugins...
    zsh-autosuggestions
)

Source 2

Installing SyntaxHighlighting

Installing SyntaxHighlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"

Source 3

Installing Completions

Installing Completions

Need oh my zsh to be installed.

git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions

Add it to FPATH in your .zshrc by adding the following line before source $ZSH/oh-my-zsh.sh

fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src

Source 4

Installing Powerlevel10k

Installing Powerlevel10k

Installing via oh my zsh

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Edit or Add ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.

Close terminal and reopen it. Powerlevel10k’s first configuration wizard should shows up automatically but if it’s not happened run it manually via:

p10k configure

Source 5

Footnotes

Footnotes
  1. https://github.com/ohmyzsh/ohmyzsh

  2. https://github.com/zsh-users/zsh-autosuggestions

  3. https://github.com/zsh-users/zsh-syntax-highlighting

  4. https://github.com/zsh-users/zsh-completions

  5. https://github.com/romkatv/powerlevel10k

Related Posts

View all »