introduce :Bundles

- unify search and browse unders same interface
This commit is contained in:
gmarik 2011-03-19 13:12:31 -05:00
parent 3f13edf6aa
commit b85b45b80f
2 changed files with 14 additions and 13 deletions

View File

@ -16,11 +16,12 @@ com! -nargs=? -bang BundleClean
com! -nargs=0 BundleDocs com! -nargs=0 BundleDocs
\ call vundle#installer#helptags(g:bundles) \ call vundle#installer#helptags(g:bundles)
com! -nargs=+ -bang BundleSearch com! -nargs=? -bang Bundles
\ silent call vundle#scripts#search('!' == '<bang>', <q-args>) \ call vundle#scripts#all('!'=='<bang>', <q-args>)
com! -nargs=0 Vundle " deprecated in favor of Bundles
\ call vundle#scripts#browse() com! -nargs=? -bang BundleSearch
\ call vundle#scripts#all('!' == '<bang>', <q-args>)
com! -nargs=0 VundleLog com! -nargs=0 VundleLog
\ silent pedit `=g:vundle_log` \ silent pedit `=g:vundle_log`

View File

@ -1,12 +1,12 @@
func! vundle#scripts#search(bang,search_str) func! vundle#scripts#all(bang, ...)
let matches = filter(s:load_scripts(a:bang), 'v:val =~? "'.escape(a:search_str,'"').'"') if a:1== '' " whether refine search string given
call s:display(['" Search results for: '.a:search_str], matches) call s:display(['" Vim scripts: '], s:load_scripts(a:bang))
let @/=a:search_str else
let matches = filter(s:load_scripts(a:bang), 'v:val =~? "'.escape(a:1,'"').'"')
call s:display(['" Search results for: '.a:1], matches)
let @/=a:1
redraw redraw
endf endif
func! vundle#scripts#browse()
call s:display(['" Vim scripts: '], s:load_scripts(0))
endf endf
func! vundle#scripts#complete(a,c,d) func! vundle#scripts#complete(a,c,d)