introduce :Bundles
- unify search and browse unders same interface
This commit is contained in:
parent
3f13edf6aa
commit
b85b45b80f
@ -16,11 +16,12 @@ com! -nargs=? -bang BundleClean
|
||||
com! -nargs=0 BundleDocs
|
||||
\ call vundle#installer#helptags(g:bundles)
|
||||
|
||||
com! -nargs=+ -bang BundleSearch
|
||||
\ silent call vundle#scripts#search('!' == '<bang>', <q-args>)
|
||||
com! -nargs=? -bang Bundles
|
||||
\ call vundle#scripts#all('!'=='<bang>', <q-args>)
|
||||
|
||||
com! -nargs=0 Vundle
|
||||
\ call vundle#scripts#browse()
|
||||
" deprecated in favor of Bundles
|
||||
com! -nargs=? -bang BundleSearch
|
||||
\ call vundle#scripts#all('!' == '<bang>', <q-args>)
|
||||
|
||||
com! -nargs=0 VundleLog
|
||||
\ silent pedit `=g:vundle_log`
|
||||
|
@ -1,12 +1,12 @@
|
||||
func! vundle#scripts#search(bang,search_str)
|
||||
let matches = filter(s:load_scripts(a:bang), 'v:val =~? "'.escape(a:search_str,'"').'"')
|
||||
call s:display(['" Search results for: '.a:search_str], matches)
|
||||
let @/=a:search_str
|
||||
redraw
|
||||
endf
|
||||
|
||||
func! vundle#scripts#browse()
|
||||
call s:display(['" Vim scripts: '], s:load_scripts(0))
|
||||
func! vundle#scripts#all(bang, ...)
|
||||
if a:1== '' " whether refine search string given
|
||||
call s:display(['" Vim scripts: '], s:load_scripts(a:bang))
|
||||
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
|
||||
endif
|
||||
endf
|
||||
|
||||
func! vundle#scripts#complete(a,c,d)
|
||||
|
Loading…
Reference in New Issue
Block a user