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

93827Re: Auto-cd to remote dir

Expand Messages
  • Ben Schmidt
    Aug 1, 2008
      > But, I digress. The OS keeps a "working directory", sure - but
      > there's no reason why vim can't have a "current directory" abstraction
      > of its own, independent of the OS.

      And without passing any comment on whether it would be a good idea to
      move netrw into Vim core, couldn't this 'current directory' abstraction
      be kept in netrw simply by supporting relative URLs? E.g. if I do

      :w sftp:myfile.txt

      then myfile.txt should be written in the current remote directory.
      Likewise, files can be looked for in the current remote directory for :e
      etc. An error could be given if the current directory is a different
      protocol to what you specify. This shouldn't be very hard to implement,
      should it?

      Over time, if desired, netrw's notion of 'current directory' could be
      kept as a window-local variable rather than a global variable, solving
      the problem of editing multiple files in different directories/on
      different servers (just as :lcd solves that problem locally). Commands
      could be provided to change that directory (:Remotecd or whatever). It
      would also mean that navigating with netrw's explorer in another window
      wouldn't affect the current directory of other windows. :Explore could
      by default explore the current remote directory, or if there is none,
      the current local directory, rather than the directory of the current
      file, which I think would make more sense.

      Ben.



      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 8 messages in this topic