See line breaks and carriage returns in editor

后端 未结 8 2140
臣服心动
臣服心动 2020-12-04 05:33

Does anyone know of a text editor on Linux that allows me to see line breaks and carriage returns? Does Vim support this feature?

相关标签:
8条回答
  • 2020-12-04 06:24

    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.

    0 讨论(0)
  • 2020-12-04 06:30

    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.

    0 讨论(0)
提交回复
热议问题