LoginSignup
5
10

More than 5 years have passed since last update.

zshのプラグインマネージャーantigenを導入する

Last updated at Posted at 2017-05-02

antigenはzshのプラグインマネージャーです。
コマンド一つで簡単に様々なzshのプラグインをインストール出来るようになります。

zsh-users/antigen

antigenのインストール

gitリポジトリをクローンするだけで完了します。
クローンする場所は何処でも大丈夫ですが、今回は~/.zsh/antigen/に配置します。

$ git clone https://github.com/zsh-users/antigen.git ~/.zsh/antigen/

.zshrcの設定

antigenの設定は.zshrcに直接書いても問題ないのですが、参考にさせて頂いたブログの記事のやり方が非常にスマートだったのでそちらに従って設定を記述していきます。
antigenの設定を他のファイルに分離するために.zshrcにはantigenの設定ファイルの読み込みだけを記述します。

# antigenの設定ファイルを読み込む
source ~/.zshrc.antigen

antigenの設定

antigenの設定は~/.zshrc.antigenという設定ファイルを作成し、そこに記述するようにします。

$ touch ~/.zshrc.antigen

公式のREADME.mdに書かれている設定の例を基に設定ファイルを記述した例です。

# antigen.zshの読み込み
source ~/.zsh/antigen/antigen.zsh

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

# 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

# oh-my-zsh以外のzshプラグインのインストール
# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting

# Load the theme.
antigen theme robbyrussell

# Tell antigen that you're done.
antigen apply

antigenの起動

ターミナルを再起動するか、以下のコマンドで.zshrcを再読み込みすれば.~/zshrc.antigenが読み込まれてantigenが利用可能になります。

$ source ~/.zshrc

参考

zshのプラグインマネージャーantigenでoh-my-zshの良いとこ取りをする - Glide Note

5
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
10