Mac line endings and vi


If Vim believes that a file has unix format, any CR will display as ^M (because CR is Ctrl-M).

Vim supports three file formats: unix (lines end with LF), dos (lines end with CR LF), and mac (lines end with CR).

Some programs create files with inconsistent line endings. For example, the first few lines may end with LF, and Vim will decide the file has the unix file format. But later lines may use CR LF and Vim may show the CR as ^M.

To replace every CR with LF (when searching, \r matches CR, but when replacing, \r inserts LF):

linux logo Powered by Apache
This site maintained by:
My public PGP key
last updated: 2007-01-24 Valid CSS! Valid XHTML 1.0 Strict