Vimプラグイン管理プラグインであるNeoBundleを使ってみた。
.vimrcや.vimなどのdotfilesはGitHubで管理しているので、submoduleとして導入。
導入方法
git clone git@github.com:ユーザー/dotfiles cd dotfiles git submodule add https://github.com/Shougo/neobundle.vim.git .vim/bundle/neobundle.vim
.vimrcに追記すること
set nocompatible filetype off if has('vim_starting') set runtimepath+=~/.vim/bundle/neobundle.vim/ endif call neobundle#rc(expand('~/.vim/bundle/')) NeoBundle 'インストールしたいプラグイン' filetype plugin indent on if neobundle#exists_not_installed_bundles() echomsg 'Not installed bundles : ' . \ string(neobundle#get_not_installed_bundle_names()) echomsg 'Please execute ":NeoBundleInstall" command.' endif
使い方
vimを開いて:NeoBundleInstallと入力すると、プラグインをまとめてインストールしてくれる。
未installのプラグインがあれば、起動時に以下のような通知をしてくれる。
Not installed bundles : ['プラグイン名'] Please execute ":NeoBundleInstall" command.
インストールしたプラグインがgit管理対象となってしまう
NeoBundleInstallでインストールしたプラグインは~/.vim/bundle配下に配置される。
GitHubにpushする気がない場合は.gitignoreを作成してnebundle.vim以外は管理対象外にしたほうが良い。
.vim/bundle/* !.vim/bundle/neobundle.vim
プロキシ環境でgit://が使えない場合
git以外のプロトコルを指定可能。
.vimrc内でNeoBundleを記述する前に以下の1行を挿入。
let g:neobundle_default_git_protocol='https' ※httpsを使う場合の例