Wednesday, November 24, 2010

Re: :ls with regular expression

On Wed, Nov 24, 2010 at 6:35 PM, Eran Borovik <eran.borovik@gmail.com> wrote:
> Hi folks,
> I am an heavy user of vim (console mode), and loves to open many buffers. I
> refrain from using tabs or the buffer explorer plugin as it takes precious
> screen space. Just navigating with :b* and:ls is great.
> One small issue though, sometimes I would like to do :ls with a regular
> expression. For example, I want :ls to show me all the chan*.c file. This is
> not possible with the current ls implementation, and trying to open such a
> buffer with :b just complains that there is more than one choice.
> Is there a workaround to this problem (either through :b or :ls)?
In most cases, doing,
:b <pattern>^D
should be sufficient?

For example, if you have loaded three buffers:
abc.txt
abc.c
xyz.c

If you do:
:b abc^D
You'll get:
abc.txt abc.c

If you do:
:b .c^D
you'll get:
abc.c xyz.c

The <pattern> above is not a regular expression, but a simple string
that is in the buffer name. ^D is of course, CONTROL+D. You can cycle
through the matches with tab/shift-tab.

--
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: