Provides a vim command to close the current buffer and replace it with another existing buffer, or a new file if the buffer deleted was the last one listed.
Call the command with :Kwbd
, or remap it to <leader>kb (mneumonic: kill buffer) with something like the following:
:nnoremap <leader>kb! Kwbd
Calling the command with the ! argument will close the current buffer whether you've saved it or not.
This script is originally from http://vim.wikia.com/wiki/VimTip165.