To get rid of those ^M use:
代码: 全选
1,$ s/^M//gc
or
% s/^M//gc
To type ^M hit ctrl+v first and then M.
代码: 全选
For ^M hit CTL-v then CTL-M or CTL-v enter
one of the oldest topics ever, see vimtip #26
Anonymous, January 31, 2007 23:28
Note that, for people using Vim with Windows keybindings, CTRL-V is (naturally) the paste operation;
so, to produce a
代码: 全选
^M, you have to type CTRL-Q then CTRL-M