Replacing carriage return ^M with Enter

To replace carriage return character (which is <C-m>) with line feed character (which is unix line break character) you should run a bit strange command:

%s/\r/\r/g

It looks like if it is doing nothing, but in regular expressions and double-quoted strings carriage returns are represented using \r and line feeds with \n, while in the replacement part of :s command and substitute() function they mean the opposite.

Note that in terminal Enter produces <C-m>, so your initial request is not valid.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)