Does anyone know of a text editor on Linux that allows me to see line breaks and carriage returns? Does Vim support this feature?
VI shows newlines (LF character, code x0A
) by showing the subsequent text on the next line.
Use the -b
switch for binary mode. Eg vi -b filename
or vim -b filename --
.
It will then show CR characters (x0D
), which are not normally used in Unix style files, as the characters ^M
.
To disagree with the official answer:
:set list
will not show ^M characters (CRs). Supplying the -b option to vi/vim will work. Or, once vim is loaded, type :e ++ff=unix
.