vim中关于^M的那些事

Unix uses 0xA for a newline character. Windows uses a combination of two characters: 0xD 0xA. 0xD is the carriage return character. ^M happens to be the way vim displays 0xD (0x0D = 13, M is the 13th letter in the English alphabet).

Where ^M is entered by holding down Ctrl and typing v followed by m, and then releasing Ctrl.

也可以直接转化成UNIX格式:

dos2unix file.txt

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *