Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
26
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@td2sk

NeoBundle周りを自動化する

概要

新しい環境に vim を入れる際、いちいち NeoBundle の準備をするのが面倒臭い。
じゃあ NeoBundle 周りは vim にやらせよう。

手順

NeoBundleの取得

NeoBundleが未取得なら、git clone を呼び出す

base.vim
if has('vim_starting')
  if !isdirectory(expand("~/.vim/bundle/neobundle.vim/"))
    echo "install neobundle..."
    :call system("git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim")
  endif
  set runtimepath+=~/.vim/bundle/neobundle.vim
endif

call neobundle#rc(expand('~/.vim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'

NeoBundleInstall の自動化

未取得の bundle があれば、起動時に取得

base.vim
" 先に Bundle の設定をする
" 例
" NeoBundle 'tomasr/molokai'
" colorscheme molokai

" vimrc の最後に書く
if(!empty(neobundle#get_not_installed_bundle_names()))
  echomsg 'Not installed bundles: '
    \ string(neobundle#get_not_installed_bundle_names())
  if confirm('Install bundles now?', "yes\nNo", 2) == 1
    " vimrc を再度読み込み、インストールした Bundle を有効化
    " vimrc は必ず再読み込み可能な形式で記述すること
    NeoBundleInstall
    source ~/.vimrc
  endif
end

リポジトリ

人の設定から切り貼りした後が随所に……

関連

エディタ戦争では中立ゆえ、 emacs 版も近々書きます

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
26
Help us understand the problem. What are the problem?