How to delete current buffer and reopen the next buffer in current window?

StackOverflow https://stackoverflow.com/questions/4313239

  •  29-09-2019
  •  | 
  •  

Pergunta

I would like to know is there any shortcuts or commands to switch buffer (delete current and reopen next buffer) in current window because sometimes I feel I opened too many buffers? And currently I use bufexplorer and fuzzyfinder.

Foi útil?

Solução

Try this:

function DelBufferAndNext()
    let s:old_bufnr = bufnr('%')
    bnext
    exec s:old_bufnr . 'bd'
    unlet s:old_bufnr
endfunction
command -nargs=0 BD call DelBufferAndNext()
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top