Created
May 12, 2011 16:59
-
-
Save svenwin/968940 to your computer and use it in GitHub Desktop.
vim clean close, preserve my splits
This file contains 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
map fc <Esc>:call CleanClose() | |
function! CleanClose() | |
let todelbufNr = bufnr("%") | |
let newbufNr = bufnr("#") | |
if ((newbufNr != -1) && (newbufNr != todelbufNr) && buflisted(newbufNr)) | |
exe "b".newbufNr | |
else | |
bnext | |
endif | |
if (bufnr("%") == todelbufNr) | |
new | |
endif | |
exe "confirm :bd".todelbufNr | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment