On Tue, 17 Nov 2009, Peng Yu wrote:
>
>
>
> John Beckett wrote:
> > Peng Yu wrote:
> > > $ grep -H -n if /etc/profile>/tmp/grep_output.txt $ cat
> > > /tmp/grep_output.txt /etc/profile:4:if [ -d /etc/profile.d ]; then
> > > /etc/profile:6: if [ -r $i ]; then
> > > /etc/profile:13:if [ "$PS1" ]; then
> > > /etc/profile:14: if [ "$BASH" ]; then
> > > /etc/profile:16: if [ -f /etc/bash.bashrc ]; then
> > > /etc/profile:20: if [ "`id -u`" -eq 0 ]; then
> > > $ gvim /tmp/grep_output.txt
> > >
> > > Now, I want to double click a line in 'grep_output.txt' so
> > > that gvim will automatically bring me the corresponding file
> > > and line. I'm wondering how to do so.
> >
> > You should use the -q option:
> >
> > gvim -q /tmp/grep_output.txt
>
> Suppose that there are more than one files in the grep results. It
> seems that 'gvim -q' only allow me to go to the first one. Right?
>
> But I want to multiple files that are output from grep.
I store the linenumber as the last line, so that I can use the
following to jump to the error line.
let linenumber = getline('$')
exe linenumber
For your case I think you can parse the content of the current line
getline(".")
extract the relevant filename and linenumber and then jump to that
line.
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---