Very often, after days and days of coding, opening vim -S session everytime, I end up with a fair long buffer list that I want to clean.
Therefore I use :ls to list all buffers, and then :bdelete several times, with a range of buffer numbers and or explicitly specifying buffer names.
The weak points in this approach are two:
- if I run
:bdeleteon a single buffer, the linesN buffers deletedandPress ENTER or type command to continuedo not appear, and the buffer list closes, so I have to run:lsagain, which is very annoying; - I have to run
:bdeleteseveral times, which is less a pain but still annoying.
If there's a cleaner way to list non-contiguous buffer names to :bdelete, that would be great, as it would solve 1 and 2; if not, then a way to prevent the closure of the output of :ls would be good enough, as it'd solve 2.
Important edit
I don't want to delete any buffer which is opened on a window in any tab.