basic logging

This commit is contained in:
gmarik 2011-07-30 19:35:16 -05:00
parent 9ff2d24fe8
commit 5bf9f8c353
2 changed files with 18 additions and 1 deletions

View File

@ -132,4 +132,10 @@ endf
func! s:system(cmd) abort func! s:system(cmd) abort
let output = system(a:cmd) let output = system(a:cmd)
call s:log(output)
endf
func! s:log(str) abort
if !exists('g:vundle_log') | let g:vundle_log = [] | endif
call add(g:vundle_log, a:str)
endf endf

View File

@ -35,16 +35,27 @@ func! vundle#scripts#setup_view() abort
sign define VuOk text=* texthl=String sign define VuOk text=* texthl=String
com! -buffer -bang -nargs=? InstallBundle call vundle#installer#install('!' == '<bang>', <q-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 :wincmd q<CR> nnoremap <buffer> q :wincmd q<CR>
nnoremap <buffer> i :exec 'Install'.getline('.')<CR> nnoremap <buffer> i :exec 'Install'.getline('.')<CR>
nnoremap <buffer> l :VundleLog<CR>
nnoremap <buffer> c :BundleClean<CR> nnoremap <buffer> c :BundleClean<CR>
nnoremap <buffer> C :BundleClean!<CR> nnoremap <buffer> C :BundleClean!<CR>
nnoremap <buffer> r :Bundles nnoremap <buffer> r :Bundles
nnoremap <buffer> R :call vundle#scripts#reload()<CR> nnoremap <buffer> R :call vundle#scripts#reload()<CR>
endf endf
func! s:view_log()
if !exists('b:log_file') | let b:log_file = tempname() | endif
call writefile(g:vundle_log, b:log_file)
silent pedit `=b:log_file`
wincmd P | wincmd H
endf
func! s:display(headers, results) func! s:display(headers, results)
if !exists('s:browse') | let s:browse = tempname() | endif if !exists('s:browse') | let s:browse = tempname() | endif
let results = reverse(map(a:results, ' printf("Bundle ' ."'%s'".'", v:val) ')) let results = reverse(map(a:results, ' printf("Bundle ' ."'%s'".'", v:val) '))