Skip to content

Instantly share code, notes, and snippets.

@suy
Created November 22, 2013 14:18
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 suy/7600583 to your computer and use it in GitHub Desktop.
Save suy/7600583 to your computer and use it in GitHub Desktop.
command! Gclose :call s:Gclose()
function! s:Gclose() abort
let previous_buffer = bufnr(expand("%"))
for buf in tabpagebuflist()
if getbufvar(buf, "fugitive_type") != ''
execute bufwinnr(buf).'wincmd w'
wincmd q
execute bufwinnr(previous_buffer).'wincmd w'
endif
endfor
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment