Vim has default
:only for windows to close them all except curren one, but there is no
You can use BufOnly plugin; just put it to your
.vim/plugin then execute
However this can be achieved with a script:
" close all buffers except current one command! BufCurOnly execute '%bdelete|edit#|bdelete#'
%bdelete command deletes all buffers.
# means the alternate filename. From
# Is replaced with the alternate file name. *:_#* *c_#* This is remembered for every window.
Put this script in you
.vimrc/$MYVIMRC, and then execute
You can map this
command to any keys as always:
" Close all buffers but current nnoremap <C-B>c :BufCurOnly<CR>