Edit Using Existing Vim

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Edit Using Existing Vim

jason heddings-2
Hello-

I can see this option on the context menu when I right click a file, but is
there a way to do this from the command line?  Meaning, I would like to be
able to run "gvim main.c" and have it show up in my existing vim session.

Thanks,
--jah

Reply | Threaded
Open this post in threaded view
|

Re: Edit Using Existing Vim

Tim Chase-2
> I can see this option on the context menu when I right click a
> file, but is there a way to do this from the command line?
> Meaning, I would like to be able to run "gvim main.c" and have
> it show up in my existing vim session.

The trick is to get Vim to be called with the "--remote"
parameter.  You can learn more about it at

        :help --remote

Thus, you simply have to modify whatever's controlling that menu
option (likely a registry key buried somewhere) so that it calls

        gvim --remote main.c

and presto :)

-tim





Reply | Threaded
Open this post in threaded view
|

Re: Edit Using Existing Vim

A.J.Mechelynck
In reply to this post by jason heddings-2
----- Original Message -----
From: "jason heddings" <[hidden email]>
To: "'vim mailing list'" <[hidden email]>
Sent: Friday, September 09, 2005 11:55 PM
Subject: Edit Using Existing Vim


> Hello-
>
> I can see this option on the context menu when I right click a file, but
> is
> there a way to do this from the command line?  Meaning, I would like to be
> able to run "gvim main.c" and have it show up in my existing vim session.
>
> Thanks,
> --jah

I'm not sure what that menu item triggers. Does it call gvimext.dll? I'm not
sure. However, you might find an alternate way of doing what you want using
client-server functionality. See ":help remote.txt".

If you want to make sure what "Edit with existing vim" does, you may have to
dig into the registry and/or into the sources of Vim and its ancillary
programs.


Best regards,
Tony.