Oh My Zsh plugins add focused shortcuts for clipboard operations, directory and command history, Git, Kubernetes, rsync, and web searches. Add only the plugins you use; a very large plugin list can slow shell startup. Manjaro users can begin with the distribution-specific setup.

Add plugin names to the plugins array in ~/.zshrc. Zsh arrays use whitespace, not commas:

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

1. copybuffer

Press Ctrl+O to copy the command currently typed at the prompt. This depends on a clipboard tool supported by Oh My Zsh being available in your desktop session.

2. copypath

Run copypath to copy the absolute path of the current directory, or copypath <file-or-directory> to copy another path. Older versions called this plugin copydir; current Oh My Zsh uses copypath.

3. copyfile

Run copyfile <filename> to place the file's contents on the system clipboard.

4. dirhistory

Use Alt+Left and Alt+Right to move backward and forward through recently visited directories. Alt+Up moves to the parent directory, and Alt+Down moves into the first child directory alphabetically. Some terminal emulators reserve these key combinations, so check the terminal keymap if they do nothing.

5. emoji

The emoji plugin provides named Zsh variables and functions for Unicode emoji. For example, echo $emoji[mouse_face] prints a specific emoji, while random_emoji chooses one at random.

6. encode64

Encode and decode Base64 text with encode64 and decode64:

encode64 "your text"
decode64 eW91ciB0ZXh0

The short aliases are e64 and d64. Base64 is an encoding, not encryption.

7. git

The git plugin supplies many aliases and helper functions for common Git operations. Run alias | grep git or consult its current README before relying on a short alias whose expansion you do not remember.

8. history

Use h to print command history, hl to browse it through less, hs <text> for a case-sensitive search, and hsi <text> for a case-insensitive search.

9. jsontools

Pipe JSON into the plugin's functions:

  • pp_json pretty-prints JSON.
  • is_json validates JSON and returns an appropriate exit status.
  • urlencode_json URL-encodes JSON.
  • urldecode_json decodes URL-encoded JSON.

The plugin needs node, python3, or ruby in PATH when it loads.

10. kubectl

If you use Kubernetes, this plugin adds command completion and many aliases for kubectl. The kubectl command itself must already be installed and configured.

11. rsync

The rsync plugin provides aliases for common copy and synchronization commands:

  • rsync-copy: rsync -avz --progress -h
  • rsync-move: rsync -avz --progress -h --remove-source-files
  • rsync-update: rsync -avzu --progress -h
  • rsync-synchronize: rsync -avzu --delete --progress -h

Read the expansion before running it. rsync-move removes transferred source files, while rsync-synchronize deletes destination files that are absent from the source.

12. sudo

Press Esc twice to prefix the current command with sudo. On an empty prompt, it retrieves the previous command and adds sudo. The same shortcut toggles the prefix, and terminal keymaps can override the binding.

Start a browser search from the terminal with either the general function or a search-engine alias:

web_search google oh-my-zsh
google oh-my-zsh
web_search duckduckgo oh-my-zsh
duckduckgo oh-my-zsh

The Oh My Zsh plugin directory contains the current README for every bundled plugin.