esamatti
esamatti

Reputation: 18973

Cross buffer search result list for Vim?

After searching in Vim you can get a list of the search results with :g//# and with :bufdo g//# you can get list of matches in all buffers.

But using it with bufdo is not really realistic since it does not show the file where the match came from or give an option to jump to the match.

Is there a plugin that would allow that?

Note that I want this for the internal Vim search because I often use it via *, # and similar shortcuts. I know that LustyExplorer (LustyBufferGrep) allows to search from all buffers, but it uses its own search input... I want reuse the internal Vim search.

Upvotes: 2

Views: 254

Answers (1)

Benoit
Benoit

Reputation: 79243

You can paste the contents of vim search register with CTRL-R+/. Other plug-ins that can do that include Buffersaurus.

It seems to be possible to integrate the internal Vim search to Buffersaurus like this:

map <Leader>b :Bsgrep <c-r>/<cr>

Hit Leader+b to open up the list.

Upvotes: 2

Related Questions