Replacing carriage return ^M with Enter

前端 未结 5 1450
一向
一向 2021-01-31 08:24

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 char

5条回答
  •  执念已碎
    2021-01-31 08:58

    Similar to @ZyX and @anubhava, but assuming you're simply trying to remove the pesky carriage returns from a windows file, the following will suffice:

    :%s/\r//g
    

提交回复
热议问题