Delete open Nvim buffers

Posted on December 31, 2024 by Riccardo

List all open buffers:

:ls

Close all open buffers:

%bd!|e#|bd#
  • %bd! foreach buffer delete
  • e# open the last buffer for editing
  • bd# delete the [No Name] buffer

Source: https://stackoverflow.com/questions/4545275/vim-close-all-buffers-but-this-one

PinkLetter

It's one of the selected few I follow every week – Mateusz

Tired of RELEARNING webdev stuff?

  • A 100+ page book with the best links I curated over the years
  • An email once a week full of timeless software wisdom
  • Your recommended weekly dose of pink
  • Try before you buy? Check the archives.