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

Vim over SCP/SSH

Expand Messages
  • OvErboRed
    I m using GVIM 6.2 on Win XP. When I try :e scp://... , vim always scp directly via cmd (the exact command is: C: WINDOWS system32 cmd.exe /c scp -q ...
    Message 1 of 3 , May 1, 2004
    • 0 Attachment
      I'm using GVIM 6.2 on Win XP. When I try ":e scp://...", vim always scp
      directly via cmd (the exact command is: "C:\WINDOWS\system32\cmd.exe /c scp
      -q ... VIABD.tmp"), so I'm prompted to enter my key passphrase, when in fact
      I have cygwin's ssh-agent package (I have a bash script that automatically
      loads it for each new session, a la keychain). How can I make vim take
      advantage of this (or at least start bash instead of cmd)?

      Also, after hitting Enter to close the command window, I also get the error:

      Error detected while processing function <SNR>16_NetRead..<SNR>16
      _NetOptionRestore:
      line 11:
      E303: Unable to open swap file for "scp://y/blackboxloc", recovery
      impossible
      Hit ENTER or type command to continue

      This shows up every time I save the file as well.

      Another annoyance is how vim always opens the file over scp again for some
      reason when I switch buffers. Why does it do this, when in fact the file
      should already be loaded?

      Thanks.
    • OvErboRed
      Thanks for pointing out those options. I now have password-less access. However, I couldn t find an option that lets me set which terminal to use when
      Message 2 of 3 , May 3, 2004
      • 0 Attachment
        Thanks for pointing out those options. I now have password-less access.
        However, I couldn't find an option that lets me set which terminal to use
        when executing shell commands (is there a way to specify none?). It uses the
        ugly cmd.exe, which has unreadable blue-on-black and makes me hit enter to
        close the window. I'm use to rxvt, but the ideal solution would be having
        vim not display any terminal.

        Aside: how do I quote the vales I set options to? I tried single and double
        quotes to no avail. Mainly I'm wondering because I currently need to set
        bash to bash\ --login, so I have to quote the space.

        I haven't had time to look into the NetOptionRestore issue yet. In the
        meantime...has on one else encountered this problem before? I've barley
        customized my vim installation, so I probably didn't introduce this problem.

        As for the autocommand problem, I used an empty .vimrc and tried
        buffer-switching from another buffer back to the scp file, but I get the
        same issue. How would I disable this apparently default behavior? And why is
        it there in the first place? I thought storage was what the buffer is for.

        Thanks.

        -----Original Message-----
        From: Charles E. Campbell, Jr. [mailto:drchip@...]
        Sent: Monday, May 03, 2004 1:39 PM
        To: OvErboRed
        Subject: Re: Vim over SCP/SSH

        OvErboRed wrote:

        >I'm using GVIM 6.2 on Win XP. When I try ":e scp://...", vim always scp
        >directly via cmd (the exact command is: "C:\WINDOWS\system32\cmd.exe /c scp
        >-q ... VIABD.tmp"), so I'm prompted to enter my key passphrase, when in
        fact
        >I have cygwin's ssh-agent package (I have a bash script that automatically
        >loads it for each new session, a la keychain). How can I make vim take
        >advantage of this (or at least start bash instead of cmd)?
        >
        >

        To use cygwin's bash, etc, I use (win2k):
        set shell=bash
        set shq=
        set sxq=\"
        set ssl
        set shcf=-c
        set sp=>&

        in my <.vimrc>.

        >Also, after hitting Enter to close the command window, I also get the
        error:
        >
        >Error detected while processing function <SNR>16_NetRead..<SNR>16
        >_NetOptionRestore:
        >line 11:
        >E303: Unable to open swap file for "scp://y/blackboxloc", recovery
        >impossible
        >Hit ENTER or type command to continue
        >
        >

        Hmm, I don't see anything in NetOptionRestore() that uses a swap file.
        I suggest activating the internal debugging statements. Get the latest
        netrw.vim and also get Decho.vim from

        http://www.erols.com/astronaut/vim/index.html#vimlinks_scripts
        as "Network Oriented Reading and Writing"
        http://www.erols.com/astronaut/vim/index.html#vimlinks_scripts
        as "Decho, a vimL debugging aid"

        Use :DechoOn
        to turn debugging on in <netrw.vim>. Then do a scp; a window should
        show up with additional information as to what's going on.

        >This shows up every time I save the file as well.
        >
        >Another annoyance is how vim always opens the file over scp again for some
        >reason when I switch buffers. Why does it do this, when in fact the file
        >should already be loaded?
        >
        >
        That sounds like you have an autocmd (BufLeave, BufEnter, or something)
        that is causing
        the file to be re-loaded every time you switch buffers.

        Regards,
        Chip Campbell
      • Antoine J. Mechelynck
        ... From: OvErboRed To: Sent: Tuesday, May 04, 2004 12:04 AM Subject: RE: Vim over SCP/SSH ... the ... AFAIK, you
        Message 3 of 3 , May 5, 2004
        • 0 Attachment
          ----- Original Message -----
          From: "OvErboRed" <overbored@...>
          To: <vim@...>
          Sent: Tuesday, May 04, 2004 12:04 AM
          Subject: RE: Vim over SCP/SSH


          > Thanks for pointing out those options. I now have password-less access.
          > However, I couldn't find an option that lets me set which terminal to use
          > when executing shell commands (is there a way to specify none?). It uses
          the
          > ugly cmd.exe, which has unreadable blue-on-black and makes me hit enter to
          > close the window. I'm use to rxvt, but the ideal solution would be having
          > vim not display any terminal.

          AFAIK, you can't. But there should be a way to change the colors and size of
          the dos box, and maybe even to have it close itself when finished.
          >
          > Aside: how do I quote the vales I set options to? I tried single and
          double
          > quotes to no avail. Mainly I'm wondering because I currently need to set
          > bash to bash\ --login, so I have to quote the space.
          [...]

          In the ":set name=value" command, any spaces (also backslashes, and maybe
          some other characters like vertical bars), which are to be part of the
          value, must be "escaped" by preceding them by a backslash. OTOH, instead of
          ":set option=value" you can also use ":let &option = [expression]", where
          [expression] evaluates to the desired string or numeric value (or to 0 for
          false or 1 for true in the case of a boolean option). For a string option,
          [expression] can be a quoted string.

          Regards,
          Tony.
        Your message has been successfully submitted and would be delivered to recipients shortly.