This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: vim 64 conflict with windows slash and swapfile


On 2/20/2019 8:28 AM, Taylor, Kit wrote:
> Don't know if this is a VIM bug or CYGWIN bug.  Probably something I have configured incorrectly.
>
> I just cut over to Cygwin 64-bit, on Windows 10, VIM 8.0, Windows command line (not bash).
> When opening a file to edit, using back slashes in the path, VIM warns "unable to open swapfile".  

I'm not sure why it would be prevented from creating a .FILENAME.swp,
but paths in cygwin (and linux and posix) use '/'.  Internally at the NT
level, many of the windows libraries, '/' is accepted.  The same may
not be true of all windows libraries.  However, you should use
the '/' delimiter for the cygwin version of vim. 

Note, '\' is a character in linux/posix/cygwin meaning to quote the
next character.  So an unquoted or double quote string will get rid
of the backslashes and produce a decoded output.

If you are in bash and want to use '\', you need to either
double the backslashes (thus quoting the '\') or put the whole
string in single quotes.

>From the bash manpage:
backslash-escaped characters replaced as specified by the
       ANSI C standard.  Backslash escape sequences, if present,  are 
decoded
       as follows:
              \a     alert (bell)
              \b     backspace
              \e
              \E     an escape character
              \f     form feed
              \n     new line
              \r     carriage return
              \t     horizontal tab
              \v     vertical tab
              \\     backslash
              \'     single quote
              \"     double quote
              \?     question mark
              \nnn   the  eight-bit  character  whose value is the octal
value
                     nnn (one to three digits)
              \xHH   the eight-bit character whose value  is  the 
hexadecimal
                     value HH (one or two hex digits)
              \uHHHH the  Unicode (ISO/IEC 10646) character whose value
is the
                     hexadecimal value HHHH (one to four hex digits)
              \UHHHHHHHH
                     the Unicode (ISO/IEC 10646) character whose value
is  the
                     hexadecimal value HHHHHHHH (one to eight hex digits)
              \cx    a control-x character
--------

> Swap file is not, in fact, created.
>   
Depending on the filename, if it contained any of the above escape
sequences, they'd be replaced with their indicated decoding.

> Not a large bug, but a nuisance.  Thanks.
>   
---
    Want to talk about nuisances...

    Bill Gates changed the file-system object separator from '/' to
'\' so that DOS would look less like CP/M -- a competing micro OS at
the time that copied the use of '/' from unix.  He was trying to avoid
the impression that he got the idea of using '/' to delineate file
system hierarchy as there was more concern about lawsuits by some companies
in "look-alike" interfaces. 

    Example: Apple, besides suing MS for its "Recycling Bin" as
Apple had a trashbin on their desktop with similar functionality also
sued some companies producing "lookalikes (Franklin) out of business.

    Apple eventually lost their lawsuit against MS as
interfaces became "uncopyrightable", while it was pointed out that Apple
had stolen many of its GUI concepts from Xerox who invented and
used them first -- and had demoed them to Wozniak and Jobs.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]