Skip to content

Instantly share code, notes, and snippets.

@fishman
Created February 28, 2009 22:17
Show Gist options
  • Save fishman/72126 to your computer and use it in GitHub Desktop.
Save fishman/72126 to your computer and use it in GitHub Desktop.
" don't close window, when deleting a buffer
command! Bclose call <SID>BufcloseCloseIt()
fu! <SID>BufcloseCloseIt()
let l:currentBufNum = bufnr("%")
let l:alternateBufNum = bufnr("#")
if buflisted(l:alternateBufNum)
buffer #
else
bnext
endif
if bufnr("%") == l:currentBufNum
enew
endif
if buflisted(l:currentBufNum)
execute "bdelete! ".l:currentBufNum
endif
endf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment