vim 中如何取代特殊字元^M

出至:http://stackoverflow.com/questions/5939142/replacing-m-with-enter

Replacing ^M with Enter

I know how to remove ^M in my files (%s/^M//g), but this one is just one line I’d like to replace ^M with enter… what’s the enter character in VIM (to use in commnad-line mode).

You can replace one character using r<CR> in normal mode.
Or you can enter a “return" in command line mode by typing <C-v><CR>.

一般模式下取代一個字元,直接用「r<CR>」。<CR>是Enter鍵的意思!

或是在命令列模式中先按下「Ctrl+V」就會出現「^」字元,接著再按下「Enter」就能順利打出「^M」這個符號了。