Loading ...
Sorry, an error occurred while loading the content.

Re: Getting Vim to use an existing window

Expand Messages
  • Eric Arnold
    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
    Message 1 of 6 , Mar 31, 2006
      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
      :h netrw
      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
      > great.
      > --
      > Sincerely
      > 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
      > be.
      > > "remote" means "find a running Vim process instead of starting a newone".
      > So,
      > > 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
      > you'd
      > > have to use a remote execution utility that delivers the Vim command to
      > the
      > > 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
      > have
      > > > an IP address or port number in the cmdline?
      > > >
      > > > It seem that the remote vim can never get launched, only the vim on
      > local
      > > > machine can be reached. Please enlighten me if I'd missed something.
      > > >
    Your message has been successfully submitted and would be delivered to recipients shortly.