Hi,

On 5/31/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
How about

set errorformat+=%f,%f:%m,%f:%l:%m

command! -nargs=* Bufgrep silent! bufdo! g/<args>/caddexpr expand("%")
. ":" . line(".") .  ":" . getline(".")

It does have a problem where it tries to open the first entry
automatically, but it opens the line contents instead of the buffer
name, but it does the right thing otherwise.  Hmm, weird.


The ":caddexpr" command will not jump to the first entry.

The ":bufdo"  command loads all the buffers and runs the specified
command. When the ":bufdo" command completes, the last buffer will
be displayed in the current window.

When the ":g" command completes the cursor will be positioned on the
last matching pattern.

So when you execute the ":Bufgrep" command, the cursor will be
positioned on the last matching pattern position in the last buffer.

- Yegappan

Reply via email to