 <p>Try the following command:</p> <pre><code>function s:WipeBuffersWithoutFiles() let bufs=filter(range(1, bufnr('$')), 'bufexists(v:val) &amp;&amp; '. \'empty(getbufvar(v:val, "&amp;buftype")) &amp;&amp; '. \'!filereadable(bufname(v:val))') if !empty(bufs) execute 'bwipeout' join(bufs) endif endfunction command BWnex call s:WipeBuffersWithoutFiles() </code></pre> <p>Usage:</p> <pre><code>:BWnex&lt;CR&gt; </code></pre> <p>Note some tricks:</p> <ul> <li><code>filter(range(1, bufnr('$')), 'bufexists(v:val)')</code> will present you a list of all buffers (buffer numbers) that vim currently has.</li> <li><code>empty(getbufvar(v:val, '&amp;buftype'))</code> checks whether buffer actually should have a file. There are some plugins opening buffers that are never supposed to be represented in filesystem: for example, buffer with a list of currently opened buffers emitted by plugins such as minibufexplorer. These buffers always have <code>&amp;buftype</code> set to something like <code>nofile</code>, normal buffers have empty buftype.</li> </ul>