On 18/01/10 11:16, Wu, Yue wrote:
On Mon, Jan 18, 2010 at 06:04:32AM +0100, Tony Mechelynck wrote:
On 18/01/10 03:12, Wu, Yue wrote:
Hi, list!
After :vimgrep /pattern/j %, how to make the cursor in quickfix window
be located on the most closing line according to the location of the
buffer that performs the vimgrep?
I'm not sure what you mean by "the buffer which performs the vimgrep".
Sorry for unclear description, let me show one example:
Open a file and go to line 200:
:e foo
200G
perform a vimgrep on the buffer(note the option j):
:vimgrep /foo/j % | copen
Now the qfx window opens, and the cursor is located on the first line, but the
buffer that do the vimgrep is located at the line 200, and maybe it's a location
which is between the two matches, say line 155 and line 220,
question is: how to quickly locate to the location of the match in qfx window
which is the nearest with the location of the buffer that is performed with
vimgrep? Here the desire line should be the match of line 220.
Don't know if it's clear now? Please let me know, thank you.
Well, either (as I said) use / or ? rather than :vimgrep, or else, look
(e.g. by looking at the statusline) what the current line is, and scroll
the QF window until you're near that line.
Best regards,
Tony.
--
"Amnesia used to be my favorite word, but then I forgot it."
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php