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

72745Re: Issue 28 in vim: out of the box, gVim 7.3.46 for Win32 cannot write swap files on Windows 7

Expand Messages
  • Benjamin Fritz
    Aug 12, 2013
    • 0 Attachment
      On Mon, Aug 12, 2013 at 2:04 AM, Bram Moolenaar <Bram@...> wrote:
      >
      > Ben Fritz wrote:
      >
      >> On Sunday, August 11, 2013 12:52:16 PM UTC-5, v...@... wrote:
      >> > Comment #7 on issue 28 by brammool...@...: out of the box, gVim
      >> >
      >>> When I launch a newly installed Vim with no files, it always launches
      >> in C:\Program Files (x86)\vim or something like that, which is not
      >> writable unless you run Vim elevated with admin privileges.
      >
      > How do you launch Vim? Do you really mean Vim or gVim? I suppose gVim,
      > since from a console you always have a current directory.
      >

      Yes, I mean gvim, sorry.

      >> Since the
      >> directory is not writable, it falls back to C:\Temp or C:\TMP which
      >> does not exist. Vim should use $TEMP and $TMP instead. These go
      >> somewhere under C:\Users\yourusername on Windows 7.
      >
      > I don't think that $TEMP is a good default current directory. The
      > desktop isn't so bad, although $HOME is probably what most people
      > expect. Obviously this only matters if you do ":w file".
      >

      I don't want $TEMP as the default current directory.

      But the 'directory' option, controlling the swap file, should contain
      $TEMP instead of C:\Temp.

      On Windows XP and before, $TEMP is defaulted to C:\Temp. But it can be changed.

      On Windows 7 (and maybe Vista, maybe 8, I don't know) C:\Temp does not
      exist at all unless the user creates it. $TEMP defaults to
      C:\Users\johndoe\AppData\Local\Temp

      The user should always have write access to $TEMP, and that's where
      Windows expects temp files to go, so it is a GOOD place for swap
      files. Especially when the current directory is not writable.

      Since C:\Temp does NOT exist by default, it is a BAD fallback for swap files.

      > The main problem is: How can Vim know that the current directory is not
      > given by the user?
      >

      Forget about current directory. The only reason it matters for this
      discussion, is that the 'directory' option contains it by default, and
      it's easy for that to be a non-writable location on properly
      configured Windows. The problem is bad hard-coded paths in 'directory'
      which should be found from environment variable instead.

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 31 messages in this topic