Mikołaj Buchwald

Deprecation warning: This web page is out of date. My current web page is located at: mikolajbuchwald.com.

Zsh Antigen

16 Feb 2019

Today I was looking for a more efficient way of loading an oh-my-zsh theme – clean (https://github.com/BrandonRoehl/zsh-clean). Until now I had to download the theme and manually install it in appropriate directory. While reading clean’s README, I stumbled upon Zsh Antigen (https://github.com/zsh-users/antigen).

Prerequisites

Install zsh:

sudo apt-get install zsh

About Antigen

Antigen is actually at the higher level than the mighty oh-my-zsh as it allows managing oh-my-zsh, it’s plugins and themes. Moreover, the author’s manifesto in README seems both justified and ambitious. Anyway, by following antigen’s setup instruction you may easily install is:

curl -L git.io/antigen > ~/antigen.zsh

Then setting up the zsh is as simple as putting few lines in your ~/.zshrc file, so edit it with:

vim ~/.zshrc

And paste the following lines:

source ~/antigen.zsh

# Load the oh-my-zsh's library.
antigen use oh-my-zsh

# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
antigen bundle heroku
antigen bundle pip
antigen bundle lein
antigen bundle command-not-found

# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting

# Load the theme.
antigen bundle BrandonRoehl/zsh-clean


# Tell Antigen that you're done.
antigen apply

Now run your zsh:

zsh

These two lines are of particular interest:

...

antigen use oh-my-zsh
...
antigen theme BrandonRoehl/zsh-clean
...

First one allows you to install oh-my-zsh, with second you can easily choose a theme.

Then you have to, of course, source your zsh:

source ~/.zshrc

Now you can enjoy easier theme selection and plugin control for zsh.


Appendix A

Check out my .zshrc at this location: https://gist.github.com/mikbuch/de96c3a65908f87288c102a0931fd43c

Appendix B

The complete workflow for installing Zsh and Antigen bundles:

sudo apt install zsh
wget "https://gist.githubusercontent.com/mikbuch/de96c3a65908f87288c102a0931fd43c/raw/5f476d339d19ed965bcfeddfe77def2d2ef08b78/.zshrc" -o ~/.zshrc
zsh

Last modified on 21 Mar 2019


Tweet