BundleSearch! will refresh scripts before search
- stay updated
This commit is contained in:
parent
7f7b3f1097
commit
014eaec120
@ -7,7 +7,7 @@ com! -nargs=+ Bundle call vundle#add_bundle(<args>)
|
||||
com! -nargs=0 BundleInstall call vundle#install_bundles()
|
||||
com! -nargs=0 BundleDocs call vundle#helptagify_bundles()
|
||||
|
||||
com! -nargs=* BundleSearch silent call vundle#scripts#search(<q-args>)
|
||||
com! -nargs=+ -bang BundleSearch silent call vundle#scripts#search("<bang>", <q-args>)
|
||||
|
||||
func! vundle#rc()
|
||||
let g:bundle_dir = expand('$HOME/.vim/bundle/')
|
||||
|
@ -1,10 +1,10 @@
|
||||
func! vundle#scripts#search(...)
|
||||
let matches = filter(eval(vundle#scripts#read()), 'v:val =~ "'.escape(a:1,'"').'"')
|
||||
func! vundle#scripts#search(bang,search_str)
|
||||
let matches = filter(eval(vundle#scripts#read(a:bang)), 'v:val =~ "'.escape(a:search_str,'"').'"')
|
||||
let results = map(matches, ' printf("Bundle \"%s\"", v:val) ')
|
||||
let temp = tempname()
|
||||
call writefile(results, temp)
|
||||
exec 'sp '.temp
|
||||
let @/=a:1
|
||||
let @/=a:search_str
|
||||
setlocal hls ft=vim
|
||||
redraw
|
||||
endf
|
||||
@ -15,9 +15,9 @@ func! vundle#scripts#fetch(to)
|
||||
exec '!mkdir -p $(dirname '.a:to.') && mv -f '.temp.' '.a:to
|
||||
endf
|
||||
|
||||
func! vundle#scripts#read()
|
||||
func! vundle#scripts#read(bang)
|
||||
let scripts_file = expand('$HOME/.vim-vundle/vim-scripts.org.json')
|
||||
if !filereadable(scripts_file)
|
||||
if '!' == a:bang || !filereadable(scripts_file)
|
||||
call vundle#scripts#fetch(scripts_file)
|
||||
endif
|
||||
return readfile(scripts_file, 'b')[0]
|
||||
|
Loading…
Reference in New Issue
Block a user