Created
March 21, 2011 02:33
-
-
Save runningskull/878930 to your computer and use it in GitHub Desktop.
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
function! Kwbd(kwbdStage) | |
if(a:kwbdStage == 1) | |
let g:kwbdBufNum = bufnr("%") | |
let g:kwbdWinNum = winnr() | |
windo call Kwbd(2) | |
execute "bd! " . g:kwbdBufNum | |
execute "normal " . g:kwbdWinNum . "" | |
else | |
if(bufnr("%") == g:kwbdBufNum) | |
let prevbufvar = bufnr("#") | |
if(prevbufvar > 0 && buflisted(prevbufvar) && prevbufvar != g:kwbdBufNum) | |
b # | |
else | |
bn | |
endif | |
endif | |
endif | |
endfunction | |
command! BD call Kwbd(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment