How to convert the ^M linebreak to 'normal' linebreak in a file opened in vim?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: vim shows on every line ending ^M How I do to replace this with a 'normal' linebreak? 回答1: This is the only thing that worked for me: :e ++ff=dos Found it at: http://vim.wikia.com/wiki/File_format 回答2: Command :%s/ /\r/g Where means type Ctrl + V then Ctrl + M . Explanation :%s substitute, % = all lines ^M characters (the Ctrl-V is a Vim way of writing the Ctrl ^ character and Ctrl-M writes the M after the regular expression, resulting to ^M special character) /\r/ with new line ( \r ) g And do it globally (not just the first occurrence on