Deleting all empty buffers in VIM -


i have 120 buffers open in vim right now. 50% of these buffers empty files. i'd somehow use bufdo! close buffers empty. there way can say:

bufdo! (something) 

where (something) conditional command bdeletes current buffer if length/size of buffer zero?

the thing can think of make function reports if buffer empty or not. this:

function! bufferisempty()     if line('$') == 1 && getline(1) == ''          return 1     else         return 0     endif endfunction  " test this: echo bufferisempty() 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -