Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend separation of concerns design principle. #706

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 52 additions & 9 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,26 @@ Now you may head towards the [Commands][] and [Configuration][] wiki pages to fu
understand Antigen's functionallity and customization.

## Usage
There are two methods for configuring Antigen. Both methods are perfectly valid but we
recommend you to adopt the
[Separation of Concerns](https://en.wikipedia.org/wiki/Separation_of_concerns) design
principle by concentrating Antigen related configurations at `.antigenrc` file.

The usage should be very familiar to you if you use Vundle. A typical `.zshrc`
might look like this:
- [Recommended method (.antigenrc + .zshrc)](#recommended-method)
- [Second method (.zshrc only)](#second-method)

source /path-to-antigen/antigen.zsh
The usage should be very familiar to you if you use Vundle. Once it's done,
you are ready to roll. The complete syntax for the `antigen bundle` command
is discussed in the [Commands][] page.

Furthermore, [In the wild][wild] wiki section has more configuration examples.
You may as well take a look at the [Show off][] wiki page for interactive mode
usage.

### Recommended method
A typical `.antigenrc` might look like this:

#!/usr/bin/env bash

# Load the oh-my-zsh's library.
antigen use oh-my-zsh
Expand All @@ -61,13 +76,41 @@ might look like this:
# Tell Antigen that you're done.
antigen apply

Open your zsh with this `.zshrc` and you should see all the bundles you defined
here, getting installed. Once it's done, you are ready to roll. The complete
syntax for the `antigen bundle` command is discussed in the [Commands][] page.

Furthermore, [In the wild][wild] wiki section has more configuration examples. You may
as well take a look at the [Show off][] wiki page
for interactive mode usage.
And a typical `.zshrc` might look like this:

# Load Antigen source
source /path-to-antigen/antigen.zsh

Open your zsh with this `.zshrc` and this `.antigenrc` and you should see all
the bundles you defined at `.antigenrc` getting installed.

### Second method

A typical `.zshrc` might look like this:

source /path-to-antigen/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 theme robbyrussell

# Tell Antigen that you're done.
antigen apply

Open your zsh with this `.zshrc` and you should see all the bundles you defined here, getting installed.

## Meta

Expand Down
4 changes: 4 additions & 0 deletions antigen.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
_ANTIGEN_INSTALL_DIR=${0:A:h}
source $_ANTIGEN_INSTALL_DIR/bin/antigen.zsh
ANTIGEN_CONFIG_FILE=~/.antigenrc
if [ -f "$ANTIGEN_CONFIG_FILE" ]; then
antigen init "$ANTIGEN_CONFIG_FILE"
fi