Saturday, February 27, 2010

Re: bdelete all buffers with same pattern extension

epanda wrote:
> I would like to bdelete buffers that I don't use anymore and it
> happens that they all are *.csv
>
> Can I bdelete *.csv ?

I suppose you could do something like

:sil bufdo if expand('%')[-4]=='.txt' | bdel | endif

or

:sil bufdo if expand('%')=~'\.txt$' | bdel | endif

The latter gives you a little more flexibility in handling the
file-names -- you can ignore case with "\c", or wipe multiple
file-types using the "\|" notation of a regexp.

-tim

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment