How to remove ^ M from Vim

Source: Internet
Author: User
How to remove ^ M & gt; echo-e & quot; I \ rlove \ rWQ from Vim. & quot; & gt; test use vim to view: I ^ Mlove ^ MWQ. so how to remove ^ M? Next we will introduce two methods to remove ^ M. First cp two copies & gt; cptesttest2 & gt; cptesttest3 first method: Use vimtest2 as shown in... how to remove ^ M> echo-e "I \ rlove \ rWQ from Vim. "> test use vim to view: I ^ Mlove ^ MWQ. so how to remove ^ M? Next we will introduce two methods to remove ^ M. First cp two copies> cp test test2> cp test test3 first method: Use the following replacement method for vim test2 :: % s/^ M/\ r/g # note that Ctrl + V + M is used to input ^ M. The second method is as follows: replace vim test3 with the following method :: % s/\ r/g # note that Ctrl + V + M is used to input ^ M and hexdump is used to view the differences between test2, test3 and test:> hexdump test0000000 0d69 running 6576 570d 2e51 running> hexdump test20000000 0a69 running 6576 570a 2e51 running> using test30000000 0a69 running 6576 570a 2e51 running the difference between converting 0d to 0a.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.