Browse Source

BundleClean uses new UI as well

- TODO: refactor: extract common code
pull/75/head
gmarik 15 years ago
parent
commit
ec8b56e7ae
3 changed files with 42 additions and 4 deletions
  1. +1
    -0
      autoload/vundle.vim
  2. +38
    -4
      autoload/vundle/installer.vim
  3. +3
    -0
      autoload/vundle/scripts.vim

+ 1
- 0
autoload/vundle.vim View File

@ -34,6 +34,7 @@ sign define Vu_error text=! texthl=Error
sign define Vu_active text=> texthl=Comment
sign define Vu_todate text=. texthl=Comment
sign define Vu_updated text=+ texthl=Comment
sign define Vu_deleted text=- texthl=Comment
endif


+ 38
- 4
autoload/vundle/installer.vim View File

@ -89,10 +89,44 @@ func! vundle#installer#clean(bang) abort
redraw!
if (a:bang || input('Are you sure you want to remove '.len(x_dirs).' bundles? [ y/n ]:') =~? 'y')
let cmd = (has('win32') || has('win64')) ?
\ 'rmdir /S /Q' :
\ 'rm -rf'
exec '!'.cmd.' '.join(map(x_dirs, 'shellescape(v:val)'), ' ')
for l in range(1,len(x_dirs))
redraw!
exec ':norm d'
sleep 1m
" goto next one
exec ':+1'
endfor
redraw!
echo 'Done!'
endif
endf
func! vundle#installer#delete(bang, dir_name) abort
let cmd = (has('win32') || has('win64')) ?
\ 'rmdir /S /Q' :
\ 'rm -rf'
let path = shellescape(expand(g:bundle_dir.'/'.a:dir_name))
let cmd .= ' '.path
let out = s:system(cmd)
call s:log('')
call s:log('Bundle '.a:dir_name)
call s:log('$ '.cmd)
call s:log('> '.out)
if 0 != v:shell_error
call s:sign('error')
return 'error'
else
call s:sign('deleted')
return 'deleted'
endif
endf


+ 3
- 0
autoload/vundle/scripts.vim View File

@ -29,10 +29,13 @@ func! vundle#scripts#setup_view() abort
syn keyword vimCommand Bundle
com! -buffer -bang -nargs=1 DeleteBundle call vundle#installer#delete('!' == '<bang>', <args>)
com! -buffer -bang -nargs=? InstallBundle call vundle#installer#install('!' == '<bang>', <q-args>)
com! -buffer -nargs=0 VundleLog call s:view_log()
nnoremap <buffer> q :silent bd!<CR>
nnoremap <buffer> d :exec 'Delete'.getline('.')<CR>
nnoremap <buffer> i :exec 'Install'.getline('.')<CR>
nnoremap <buffer> I :exec 'Install'.substitute(getline('.'), '^Bundle ', 'Bundle! ', '')<CR>


Loading…
Cancel
Save