I have something like 120 buffers open in Vim right now. About 50% of these buffers are empty files. I would like to somehow use the :bufdo! command to close all the buffers that are empty. Is there a way I can say:
:bufdo! ‹cmd›
Where ‹cmd› is a conditional command that :bdeletes the current buffer if the length/size of that buffer is zero?
The only thing that I can think of for this is to make a function that
reports if the buffer is empty or not. Something like this: