Why does ^M represent a carriage return?

Posted by dotancohen on Super User See other posts from Super User or by dotancohen
Published on 2014-06-05T08:31:31Z Indexed on 2014/06/05 9:30 UTC
Read the original article Hit count: 165

Filed under:

Why is ^M used to represent a carriage return in VIM and other contexts? My guess is that M is the 13th letter of the Latin alphabet and a carriage return is \x0D or decimal 13. Is this the reason? Is this representation documented anywhere?

EDIT: I notice that Tab is represented by ^I, which is the ninth letter of the Latin alphabet. Conversely, Tab is \x09 or decimal 9, which supports my theory stated above. However, where might this be documented as fact?

© Super User or respective owner

Related posts about encoding