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

Re: Hiding ^M

Expand Messages
  • Ben Schmidt
    ... Well, I think I can see the reason for it. If for some reason they re being highlighed as errors or something and it looks messy, including them in the
    Message 1 of 3 , Apr 3, 2008
      > I'm asking about the last comment, under "Hide unwanted text", which is a
      > suggestion to hide ^M line endings. I agree with the view that hiding ^M is
      > generally a mistake (instead, the issue should be fixed).
      >
      > However, for those who want to hide ^M, I would like to fix the suggestion
      > which currently says:
      >
      > :highlight UglyDosLineend guifg=bg guibg=bg
      > :match UglyDosLineend /\s*\zs\r/
      >
      > I propose replacing the above two lines with:
      >
      > :match Ignore /\r/
      >
      > Is that right? I can't see any reason for the "\s*\zs" stuff, but before
      > deleting it I'd like to know if I'm overlooking something.

      Well, I think I can see the reason for it. If for some reason they're being
      highlighed as errors or something and it looks messy, including them in the
      pattern makes things look neat--hiding even more problems!

      I think it's best to remove it, though, and keep the tip strictly to the ^M issue.

      I don't think I agree with the suggestion of including $ in the pattern. Sometimes
      you can get a file with mixed Mac and Unix line endings, and in this case, you see
      a lot of ^Ms that are not at the ends of lines. There are reasons for wanting to
      preserve this, but hide them, and the solution is more general then than requiring
      the ^M at the end of a line, which only deals with mixed DOS and Unix line
      endings, not mixed Mac and Unix ones. (Incidentally, I opened such a file recently
      and because of the order of my ffs, or the nature of the file, it was recognised
      as a Mac line ending file--I saw multiple ^Js per line in my text!)

      Ben.




      --~--~---------~--~----~------------~-------~--~----~
      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.