Install zsh on Manjaro i3

This is how to quickly and easily get up and running with zsh on Manjaro i3. First, check the shell you are currently using:

1
2
[manjaro@manjaro ~]$ echo $SHELL
/bin/bash

Install zsh:

1
[manjaro@manjaro ~]$ sudo pacman -S zsh

However this might not be necessary because it looks like as of Manjaro 20.0.1, zsh is installed now by default, and looks pretty good

1
2
3
4
5
6
7
8
9
10
11
12
13
zsh                                                      [Installed] 5.8-1     extra
    A very advanced and programmable command interpreter (shell)
    for UNIX
zsh-autosuggestions                                      [Installed] 0.6.4-1   community
    Fish-like autosuggestions for zsh
zsh-completions                                          [Installed] 0.31.0-1  community
    Additional completion definitions for Zsh
zsh-history-substring-search                             [Installed] 1.0.2-1   community
    ZSH port of Fish history search (up arrow)
zsh-syntax-highlighting                                  [Installed] 0.7.1-1   community
    Fish shell like syntax highlighting for Zsh
manjaro-zsh-config                                       [Installed] 0.11-1    community
    Zsh configuration for manjaro

Switch to zsh:

1
2
3
[manjaro@manjaro ~]$ zsh
manjaro@manjaro Linux 5.6.12-1-MANJARO x86_64 20.0.1 Lysia
~ >>>

Then exit to quit again.

1
2
~ >>> exit                                                                             
[manjaro@manjaro ~]$

To install Oh My Zsh, you’ll find it in the AUR:

1
2
3
4
5
6
~ >>> pamac search --aur oh-my-zsh
oh-my-zsh-git                                                               r5620.31eca46ee-1       AUR
    A community-driven framework for managing your zsh configuration.
    Includes 180+ optional plugins and over 120 themes to spice up your
    morning, and an auto-update tool so that makes it easy to keep up with
    the latest updates from the community

And then install it with:

1
~ >>> pamac build oh-my-zsh-git

However to use it, you have to copy /usr/share/oh-my-zsh/zshrc to ~/.zshrc. First we backup the original one:

1
2
3
4
5
~ >>> cp -v .zshrc .bkp_zshrc-orig                                                                    
'.zshrc' -> '.bkp_zshrc-orig'
~ >>> cp -v /usr/share/oh-my-zsh/zshrc .zshrc                                                         
cp: overwrite '.zshrc'? yes
'/usr/share/oh-my-zsh/zshrc' -> '.zshrc'

Then exit, and then zsh again:

1
2
3
~ >>> exit                                                                                            
[manjaro@manjaro ~]$ zsh
➜  ~

To enable zsh-syntax-highlighting and zsh-autosuggestions, first make sure they are installed and then add the following two lines to your ~/.zshrc.

1
2
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

Lastly, you;ll want to make sure you change your default shell:

1
2
3
4
➜  ~ chsh -s $(which zsh)
Changing shell for manjaro.
Password:
Shell changed.

Be the first to comment

Leave a Reply