Skip to content

Instantly share code, notes, and snippets.

@DeaR DeaR/neobundle_git_gc.vim
Last active Dec 16, 2015

Embed
What would you like to do?
NeoBundleをたまには git gc したかった
function! s:neobundle_git_gc(names)
let names = split(a:names)
let bundles = empty(names) ?
\ neobundle#config#get_neobundles() :
\ neobundle#config#search(names)
let cwd = getcwd()
try
for bundle in bundles
if bundle.type != 'git'
continue
endif
if isdirectory(bundle.path)
lcd `=bundle.path`
endif
call system('git gc')
endfor
finally
if isdirectory(cwd)
lcd `=cwd`
endif
endtry
endfunction
command! -complete=customlist,neobundle#complete_bundles -nargs=?
\ NeoBundleGitGc :call s:neobundle_git_gc(<q-args>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.