Terminal/Shell is a very frequently used tool when programming. Among them ZSH became very popular recent years. There are a lot of extensions/plugins to make them rich in functions. Oh-my-zsh is one of the framework eastablished a way for extensions to injected themself to shell. It is a extension/plugin managment system. There are a lot of developers providing plugins which follows the oh-my-zsh style. For the official oh-my-zsh plugins, you can find them in the github repo.

The problem

With the rich of plugins, there comes a problem with oh-my-zsh that it became harder and harder to managing the plugins in oh-my-zsh, and the shell became slower and slower when there are so manythings to execute all at time in sequence. Things like syntax highlights, autocompletes for command, autocomplete for git which has to run some git commands to get promotes have to run in sequence in oh my zsh. And even worse, the theme also needs to run git command to fetch your current folder/branch/stat for the repo to display their informative promotes bar. That became a battle between features and performance.

Could we have both

The answer is yes. People since then developed many different zsh plugin manager to adress the problems. There are plenty of choices from Internet. The one I choose is antidote which is fast and simple to use. Here is a brief history from its webiste

The original Antigen plugin manager was slow. Antibody was written to address this, but was written in Go, not Zsh. Other native Zsh plugin managers caught up on speed, so it was deprecated. But Antibody had some nice features that aren’t in other Zsh plugin managers. So Antidote was created to carry on as the next generation of antigen-like Zsh plugin managers.

Installation

The installation of antidote is quit simple.

  1. Clone the antidote from github
    git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
    
  2. Load it in ~/.zshrc Put the antidote load right after # User configuration ```

    User configuration

    source antidote

    source ${ZDOTDIR:-~}/.antidote/antidote.zsh

initialize plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txt

antidote load

3. Add plugins you want to ~/.zsh_plugins.txt. You have to create the file after antidote installation. 

## My ~/.zsh_plugins.txt

ohmyzsh/ohmyzsh path:plugins/git ohmyzsh/ohmyzsh path:plugins/kubectl

romkatv/powerlevel10k

zsh-users/zsh-autosuggestions zsh-users/zsh-syntax-highlighting marlonrichert/zsh-autocomplete zsh-users/zsh-history-substring-search ```

  1. git plugin is a must have for me as I do coding all the time. Even now writing the blog is also following my coding workflow :)
  2. kubectl plugin: This is a plugin simplify a lot of command when deal with kubernetes clusters.
  3. zsh-autosuggestions: This give you the command suggestions, like the flag for a command etc.
  4. zsh-syntax-highlighting: Highlight, who doesn’t like? Or you prefer single color :).
  5. zsh-autocomplete: Newly added for me, still exploring its capability.
  6. zsh-history-substring-search: a better tool than the original history search.

One more thing: Powerlevel10K

You probably noticed I have romkatv/powerlevel10k in my plugins list. This is my favorite theme for zsh. It gives you a lot of informations about your current folder, your git repo, time, the kubernetes cluster you are aiming for. Tongs of information. Higly recommended. You can find more information in its website. Project creation