Re: Getting Vim to use an existing window
- I suspect that vim/gvim doesn't know how to do this. However, if you're in a
Xwindows type environment, you can set $DISPLAY back to your machine, and the
gvim running on the remote machine will display on your screen. I know this
isn't exactly what you want, but it's something.
Another idea is to invoke gvim on the remote machine, and supplying the
information to your local gvim about how to get to the remote file. Try
I don't have a way to test it, but it might be something like:
ssh your_local_machine gvim --remote ftp://other_machine_name/path/file
As far as I can tell, there is no Vim "client", i.e. a Vim that starts as a
background process, and communicates with a GUI/etc window. However, the docs
say that the communication goes through the X11 messaging, so it seems
reasonable that the "servername" might include syntax to include the IP address
or machine name.
--- panshizhu@... wrote:
> Probably I'm not making things clear, say, to run a command on remote
> machine is easy, I can use ssh like: ssh machine-name gvim filename. This
> works on both Unix and MSWin. But we can only open remote files on remote
> machine on the remote gvim, that's not what I want.
> What I want is to open local files on local machine and the file got edit
> on a remote gvim on a remote machine. If the gvim session could be called
> "server", I think that's a reasonable request and that's what I expect a
> server should do.
> A typical application for this might be: I have a gvim locally, and now
> I've got a terminal connected to remote machine, I want to edit files on
> the remote machine, say ~/foobar.c, but I want the files get displayed in
> gvim on my local machine. I know it is possible to open the file directly
> inside my local gvim but that's not the intuitive way, if I can just stay
> in the remote CLI and let the file edited by local gvim that would be
> Pan, Shizhu. ext: 2221
> Eric Arnold <eric_p_arnold@...> wrote on 2006.03.31 15:40:33:
> > I don't think that the --remote option is as "remote" as you want it to
> > "remote" means "find a running Vim process instead of starting a newone".
> > it's only looking on the local process table, as you noticed.
> > If want something to run in a Vim on a different machine (really??) then
> > have to use a remote execution utility that delivers the Vim command to
> > other machine to execute there. I know it's easy on Unix (i.e. rsh
> > machine-name gvim --remote filename ). I don't know about MSwin.
> > > I had always been confusing on how to open a file in remote vim. Can I
> > > an IP address or port number in the cmdline?
> > >
> > > It seem that the remote vim can never get launched, only the vim on
> > > machine can be reached. Please enlighten me if I'd missed something.
> > >