Add Oh My Zsh plugins to Manjaro's existing Zsh setup without replacing the distribution's prompt configuration. Before editing anything, inspect ~/.zshrc and /etc/skel/.zshrc because Manjaro editions and installations can differ.

Check Manjaro's Zsh Configuration

Manjaro commonly provides its own Zsh configuration and prompt. If you like that setup but want Oh My Zsh's plugin shortcuts, you can load Oh My Zsh without selecting a second theme.

The example below expects these two files:

ls -l /usr/share/zsh/manjaro-zsh-config /usr/share/zsh/manjaro-zsh-prompt

If either path is missing, compare your current ~/.zshrc with /etc/skel/.zshrc and keep the paths supplied by your installed Manjaro edition. Do not replace a working configuration with the example blindly.

The Manjaro configuration used here includes three useful shell helpers:

  • zsh-autosuggestions
  • zsh-history-substring-search
  • zsh-syntax-highlighting

Install Oh My Zsh

Install the packaged version:

pamac install oh-my-zsh

Pamac may offer optional themes. This setup keeps Manjaro's prompt, so no additional Oh My Zsh theme is required.

Back Up and Edit .zshrc

If your account does not yet have a .zshrc, start with Manjaro's current skeleton file. Then make a dated backup before editing:

test -e ~/.zshrc || cp /etc/skel/.zshrc ~/.zshrc
cp ~/.zshrc ~/.zshrc.backup-$(date +%Y%m%d-%H%M%S)
nano ~/.zshrc

Add the packaged Oh My Zsh location near the top:

export ZSH="/usr/share/oh-my-zsh"

Keep the Manjaro configuration already in the file. In the configuration used for this guide, that section is:

# Use powerline
USE_POWERLINE="true"

# Source Manjaro Zsh configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
  source /usr/share/zsh/manjaro-zsh-config
fi

# Use Manjaro Zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
  source /usr/share/zsh/manjaro-zsh-prompt
fi

After that section, choose the plugins you want and source Oh My Zsh:

plugins=(
  copybuffer
  copypath
  copyfile
  dirhistory
  emoji
  encode64
  git
  history
  jsontools
  kubectl
  rsync
  sudo
  web-search
)

source "$ZSH/oh-my-zsh.sh"

The current plugin is named copypath; the older copydir name is no longer included in Oh My Zsh. Zsh arrays use spaces or new lines between entries, not commas. The companion guide, Top Useful Oh-My-Zsh Plugins, explains what each entry does.

Check the current plugin directory before enabling more plugins, especially those that wrap external programs. Apply the configuration to the current shell:

source ~/.zshrc

If Zsh reports an error, restore the dated backup and open a new terminal before changing anything else.