Last active
December 16, 2015 20:49
-
-
Save DeaR/5495196 to your computer and use it in GitHub Desktop.
NeoBundleをたまには git gc したかった
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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