Viewing \n and \r characters in Vim?

leeand00 picture leeand00 · May 15, 2012 · Viewed 8.1k times · Source

Is there a way to make \n or \r characters visible in vim? (I want to be able to see if the csv file I am looking at uses just \n or \r and \n at the end of lines.

Answer

Ingo Karkat picture Ingo Karkat · May 15, 2012
:setl fileformat?

dos means CR-LF (consistently; if only some lines contain both, it'll be listed as unix, and you'll see ^M characters at the end of those lines), unix means LF; mac means only CR newlines.