LoginSignup
36
36

More than 5 years have passed since last update.

NeoBundleLazyをvimrcに導入した。

Last updated at Posted at 2013-01-17

これまで以下の3つのプラグインは、NeoBundleLazyしてもNeoBundleSourceしないといけないので(面倒だし)、NeoBundleだとVimの起動が遅くなるから極力ロードしないようにしていたのだけど、hooks.on_source()が導入されたのでNeoBundleLazyを導入した。

NeoBundle 'Shougo/vimfiler'
NeoBundle 'Shougo/vimshell'
NeoBundle 'Shougo/unite.vim'

とりあえず、↓こんな感じになった。導入したらVimの起動時間が4秒くらいだったのが2秒まで縮まった!

NeoBundleLazy 'Shougo/vimfiler', {
\   'autoload' : { 'commands' : [ 'VimFilerBufferDir' ] },
\   'depends': [ 'Shougo/unite.vim' ],
\ }
let s:bundle = neobundle#get('vimfiler')
function! s:bundle.hooks.on_source(bundle)
  " ココにvimfilerの設定とか記述する。
endfunction

NeoBundleLazy 'Shougo/unite.vim' , {
\   'autoload' : { 'commands' : [ 'Unite' ] }
\ }
let s:bundle = neobundle#get('unite.vim')
function! s:bundle.hooks.on_source(bundle)
  " ココにunite.vimの設定とか記述する。
endfunction

NeoBundleLazy 'Shougo/vimshell', {
\   'autoload' : { 'commands' : [ 'VimShellBufferDir' ] },
\   'depends': [ 'Shougo/vimproc' ],
\ }
let s:bundle = neobundle#get('vimshell')
function! s:bundle.hooks.on_source(bundle)
  " ココにvimshellの設定とか記述する。
endfunction

nnoremap <leader>g  :<C-u>Unite grep -no-quit<CR>
nnoremap <leader>u  :<C-u>Unite file_mru<CR>
nnoremap <leader>f  :<C-u>VimFilerBufferDir<CR>
nnoremap <leader>s  :<C-u>VimShellBufferDir<CR>

あと、vimrc内でvimfiler#set_execute_file()を呼んでいたので、
今までVimの起動が1秒ほど遅くなっていたみたい...orz。vimrc内でautoload関数をホイホイ呼ぶものじゃないねぇ。

36
36
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
36
36