项目作者: yanyingwang

项目描述 :
A plugin manager for zsh, inspired by antigen.
高级语言: Shell
项目地址: git://github.com/yanyingwang/antibody.git
创建时间: 2014-12-10T10:43:09Z
项目社区:https://github.com/yanyingwang/antibody

开源协议:MIT License

下载


Antibody

A plugin manager for zsh, inspired by antigen

Qucick Start

  1. sudo aptitude install zsh # for ubuntu
  2. sudo chsh -s zsh
  3. git clone https://github.com/yanyingwang/.zsh.git $HOME/.zsh && \
  4. echo '$HOME/.zsh/zshrc' >> $HOME/.zshrc

Open a new terminal and wait for a second, everything will be setted.

A Practical Usage

my own zsh conf file is written by using this plugin manager, you can have a check at: https://github.com/yanyingwang/.zsh

Directory structure

  1. /home/user/zsh/
  2. |---zshrc
  3. |---bundle
  4. |-----antibody
  5. | \------antibody.zsh
  6. |
  7. |-----oh-my-zsh
  8. | |--------plugins/*
  9. | |--------themes/*
  10. |
  11. |----github-zsh-users-zsh-syntax-highlighting
  12. |----other plugins

Just like Vim plugin managers, Antibody puts itself and other plugins into “bundle” directory, config zshell through zshrc file.

Details

Auto clone Antibody for the first time

Puts code below to zshrc file to auto clone Antibody for the first time.

  1. cd ${0:a:h}
  2. # auto pull in antibody
  3. [[ ! -d bundle ]] && mkdir bundle
  4. [[ ! -d bundle/antibody ]] && git clone https://github.com/yanyingwang/antibody.git bundle/antibody

Get antibody working

Puts code below to zshrc file to get it working

  1. source bundle/antibody/antibody.zsh

Antibody CMD explain

help

  1. antibody help

After source antibody.zsh, you can type antibody help in your terminal to view antibody manual.

github

  1. antibody github username/repo

You can use Antibody with github repo plugin, just add code antibody github usename/repo to your zshrc, Antibody will clone repo if it doesn’t exist.

Note: When using github repo plugins, be note that Antibody is only source three kinds of files: repo_name.zsh, whatever.plugin.zsh, whatever.theme.zsh.

For example, there is a zsh plugin waga, links is https://github.com/yanyingwang/waga, and we should wirte code antibody github yanyingwang/waga to zshrc to get ‘waga’ plugin working.

In this example, Antibody will source file waga.zsh in waga plugin. And if there is a ‘test.plugin.zsh’ or ‘test.theme.zsh’, Antibody will source it, too.

oh-my-zsh

You can use oh-my-zsh’s themes and plugins.

In the condition, Antibody will clone the whole oh-my-zsh repo to local bundle directory, but you can just use one plugin of it.

oh-my-zsh theme

  1. antibody oh-my-zsh theme robbyrussell

For example, I want to use ‘robbyrussell’ theme, just add code antibody oh-my-zsh theme robbyrussel to ‘zshrc’.

oh-my-zsh plugin

  1. antibody oh-my-zsh git
  2. antibody oh-my-zsh git rails

You can add mutiple plugin in one line, just add plugin at end of the code.

Write your own plugin

You can write you own plugin and put it to your github, and ensure there is a ‘repo_name.zsh’ or ‘whatever.plugin.zsh’ or ‘whatever.theme.zsh’ at the root of your repo direcotry.

Then, just add antibody github your_github_usename/your_plugin_repo_name to ‘zshrc’.