map R key to reload bundles

This commit is contained in:
gmarik 2011-03-19 17:41:37 -05:00
parent 617ccb62ec
commit 8496d6c604
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,6 @@
func! vundle#scripts#all(bang, ...) func! vundle#scripts#all(bang, ...)
let info = ['"Keymap: i - Install bundle; c - Cleanup; r - Refine list'] let b:match = ''
let info = ['"Keymap: i - Install bundle; c - Cleanup; r - Refine list; R - Reload list']
if a:1== '' " whether refine search string given if a:1== '' " whether refine search string given
let matches = s:load_scripts(a:bang) let matches = s:load_scripts(a:bang)
call s:display(info, matches) call s:display(info, matches)
@ -9,10 +10,16 @@ func! vundle#scripts#all(bang, ...)
let @/=a:1 let @/=a:1
" TODO: highlight doesn't work " TODO: highlight doesn't work
setl hls setl hls
let b:match = a:1
endif endif
echo len(matches).' bundles found' echo len(matches).' bundles found'
endf endf
func! vundle#scripts#reload() abort
silent exec ':Bundles! '.(exists('b:match') ? b:match : '')
redraw!
endf
func! vundle#scripts#complete(a,c,d) func! vundle#scripts#complete(a,c,d)
return join(s:load_scripts(0),"\n") return join(s:load_scripts(0),"\n")
endf endf

View File

@ -8,3 +8,4 @@ nnoremap <buffer> i :call vundle#scripts#install()<CR>
nnoremap <buffer> r :Bundles nnoremap <buffer> r :Bundles
nnoremap <buffer> c :BundleClean<CR> nnoremap <buffer> c :BundleClean<CR>
nnoremap <buffer> C :BundleClean!<CR> nnoremap <buffer> C :BundleClean!<CR>
nnoremap <buffer> R :call vundle#scripts#reload()<CR>