Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DeaR
Last active December 16, 2015 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeaR/5495196 to your computer and use it in GitHub Desktop.
Save DeaR/5495196 to your computer and use it in GitHub Desktop.
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