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

Switching between DOS and Unix file formats.

Expand Messages
  • Stephen Rasku
    I am working with some third party source that was edited on Windows using another editor. The file is mostly DOS format but not quite (i.e. most of the
    Message 1 of 1 , Jun 7, 2002
    • 0 Attachment
      I am working with some third party source that was edited on Windows
      using another editor. The file is mostly DOS format but not quite
      (i.e. most of the lines are <CR><NL> but some are just <NL>).

      I am editing these files and my own files (which are pristine Unix
      format) on Solaris. I tried adding modelines to the third party files
      so that I wouldn't see the ugly ^M's. However, it causes my files to
      revert to DOS when I edit them. So, I added modelines to my own files
      to switch back. However, vim doesn't seem to handle switching between
      these files correctly. (Or, I don't know how to set the modelines
      correctly. I don't know which possiblity is more likely)

      For the following two files, if I edit "unix" followed by "dos", it
      will prompt me to save "dos" even though I didn't change it. If I
      save it and go back to "unix", it says "[CR missing][dos]" even though
      ffs is set to "unix,dos". I would expect that to prefer Unix format
      to DOS. In fact, ":he ffs" indicates this. I have also seen the "[CR
      missing][dos]" message but ":set ff" indicates "unix". I am not sure
      under which exact circumstances this will happen. If I can figure it
      out, I will let you know.

      I am using vim 6.1 on Solaris 7.
    Your message has been successfully submitted and would be delivered to recipients shortly.