It sounds like you are asking two things. One problem is \r vs. \n others have reviewed.
Another problem is \n on the right side of the lookup. If you look :hs/\n , it says that \n in the replacement part of the substitution insert is a <NUL> / <NL> , not a new line.
If you execute :%s/\n/\n/ and save and open the file in a hex editor, all ^@ characters will be ASCII 0 (NUL characters). Why do Vim developers use \n on the left for the end of the line, and \n on the right for NUL - outside of me. But this particular behavior has nothing to do with Windows and Unix.
Brian Carper Dec 08 '08 at 20:37 2008-12-08 20:37
source share