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

Setting 'directory' list in Windows

Expand Messages
  • Gary Johnson
    Appending to a directory in the directory option in order to have Vim include the full path in the swap file name appears to work only for the last
    Message 1 of 1 , Aug 3, 2008
      Appending "\\" to a directory in the 'directory' option in order to
      have Vim include the full path in the swap file name appears to work
      only for the last directory in the 'directory' list. If "\\" is
      appended to any other directory in the list, Vim appears to first
      parse the resulting "\," pair as a comma in the file name rather
      than as an option element separator. I could not get any of the
      following to work.

      set directory=$TMP\\,$TEMP\\
      set directory=$TMP\\\,$TEMP\\\
      set directory=$TMP\\\\,$TEMP\\\\

      Whenever I edited a file, Vim would display an error message like
      this one:

      E303: Unable to open swap file for "C:\Program Files\Vim\_vimrc", recovery impossible

      I was able to work around the problem by appending "//" instead of
      "\\", like this

      set directory=$TMP//,$TEMP//

      I can see how this could be a consequence of how the option parser
      has to work rather than being a bug. If that's the case, then I
      think that restriction should be mentioned in ":help 'directory'",
      perhaps by including a statement like this below the paragraph
      beginning "- For Unix and Win32, ...."

      Because commas preceded by a backslash are considered part of the
      directory name, a directory ending in "\\" cannot precede a
      comma. Only the last directory in the list may end in "\\". To
      end any directory preceding a comma with two path separators, use
      "//" instead of "\\".

      Regards,
      Gary


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.