Compare commits

...

1 Commits

Author SHA1 Message Date
  gmarik 5d2a24f27e Experimental BundleMake command 12 years ago
5 changed files with 42 additions and 3 deletions
Split View
  1. +3
    -0
      autoload/vundle.vim
  2. +9
    -0
      autoload/vundle/config.vim
  3. +16
    -2
      autoload/vundle/installer.vim
  4. +10
    -1
      autoload/vundle/scripts.vim
  5. +4
    -0
      test/vimrc

+ 3
- 0
autoload/vundle.vim View File

@ -16,6 +16,9 @@ com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch
com! -nargs=? -bang -complete=custom,vundle#scripts#complete Bundles
\ call vundle#scripts#all('!'=='<bang>', <q-args>)
com! -nargs=1 -bang BundleMake
\ call vundle#config#add_make_cmd(<q-args>)
com! -nargs=0 -bang BundleList
\ call vundle#installer#list('!'=='<bang>')


+ 9
- 0
autoload/vundle/config.vim View File

@ -27,6 +27,11 @@ func! vundle#config#init_bundle(name, opts)
return extend(opts, copy(s:bundle))
endf
func! vundle#config#add_make_cmd(cmd)
" TODO: handle error
call g:bundles[-1].set_make_cmd(a:cmd)
endf
func! s:parse_options(opts)
" TODO: improve this
if len(a:opts) != 1 | return {} | endif
@ -84,6 +89,10 @@ endf
let s:bundle = {}
func! s:bundle.set_make_cmd(cmd)
call extend(self, {'make_cmd': a:cmd})
endf
func! s:bundle.path()
return s:expand_path(g:bundle_dir.'/'.self.name)
endf


+ 16
- 2
autoload/vundle/installer.vim View File

@ -4,14 +4,14 @@ func! vundle#installer#new(bang, ...) abort
\ map(copy(a:000), 'vundle#config#init_bundle(v:val, {})')
let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec'))
call vundle#scripts#view('Installer',['" Installing bundles to '.expand(g:bundle_dir)], names + ['Helptags'])
let make_cmds = vundle#scripts#bundle_make_cmds(bundles)
call vundle#scripts#view('Installer',['" Installing bundles to '.expand(g:bundle_dir)], names + make_cmds + ['Helptags'])
call s:process(a:bang, (a:bang ? 'add!' : 'add'))
call vundle#config#require(bundles)
endf
func! s:process(bang, cmd)
let msg = ''
@ -96,6 +96,20 @@ func! vundle#installer#install(bang, name) abort
return s:sync(a:bang, b)
endf
func! vundle#installer#make(name) abort
call s:log(' ')
call s:log('Make: '.a:name)
let b = filter(copy(g:bundles), 'v:val.name_spec ==? "'.a:name.'"')[0]
try
silent exec b.make_cmd
return 'updated'
catch
return 'error'
endtry
endf
func! vundle#installer#docs() abort
call vundle#installer#helptags(g:bundles)
return 'updated'


+ 10
- 1
autoload/vundle/scripts.vim View File

@ -33,10 +33,15 @@ func! s:view_log()
wincmd P | wincmd H
endf
func vundle#scripts#bundle_names(names)
func! vundle#scripts#bundle_names(names)
return map(copy(a:names), ' printf("Bundle ' ."'%s'".'", v:val) ')
endf
func! vundle#scripts#bundle_make_cmds(bundles)
let bundles_with_make = filter(copy(a:bundles), 'has_key(v:val, "make_cmd")')
return map(bundles_with_make, ' printf("Make ' ."'%s'".' '.'", v:val.name_spec) ')
endf
func! vundle#scripts#view(title, headers, results)
if exists('g:vundle_view') && bufloaded(g:vundle_view)
exec g:vundle_view.'bd!'
@ -61,6 +66,7 @@ func! vundle#scripts#view(title, headers, results)
setl syntax=vim
syn keyword vimCommand Bundle
syn keyword vimCommand Helptags
syn keyword vimCommand Make
com! -buffer -bang -nargs=1 DeleteBundle
\ call vundle#installer#run('vundle#installer#delete', split(<q-args>,',')[0], ['!' == '<bang>', <args>])
@ -71,6 +77,9 @@ func! vundle#scripts#view(title, headers, results)
com! -buffer -bang -nargs=? InstallBundle
\ call vundle#installer#run('vundle#installer#install', split(<q-args>,',')[0], ['!' == '<bang>', <q-args>])
com! -buffer -bar -bang -nargs=1 InstallMake
\ call vundle#installer#run('vundle#installer#make', split(<q-args>,',')[0], [split(<args>,',')[0]])
com! -buffer -bang -nargs=0 InstallHelptags
\ call vundle#installer#run('vundle#installer#docs', 'helptags', [])


+ 4
- 0
test/vimrc View File

@ -52,6 +52,10 @@ Bundle 'rstacruz/sparkup.git', {'rtp': 'vim/'}
" Camel case
Bundle 'vim-scripts/RubySinatra'
Bundle 'wincent/Command-T.git'
BundleMake :ruby puts( cmd = "cd #{File.expand_path($LOAD_PATH.grep(/command-?t/i).first)}/command-t/ && git checkout -f master && ruby extconf.rb && make clean && make");
\ system(cmd)
filetype plugin indent on " Automatically detect file types.
set wildignore+=doc " should not break helptags


Loading…
Cancel
Save