Get the App
SLTechnology News&Howtos  ›  Development  › 

How does vim delete the end of a line?

Shulou Source: shulou.com Published: 2022-06-01 16:51:20 10月04日 Update

In this article, the editor introduces in detail "how to delete the end of a line in vim". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to delete the end of a line in vim" can help you solve your doubts.

After pull the file from git, I accidentally opened it with vim and found that every line has ^ M at the end of the line, and then I opened it with vi. Open it with eclipse or gedit but not.

Html {^ M font-size: small; ^ M font-family: arial, sans-serif; ^ M} ^ M body {^ M background: # fff; ^ M margin: 0 auto; ^ M color: # 000; ^ M font-family: 13px/18px Arial,Tahoma,Verdana; ^ M width:80%; ^ M border-right:1px solid # 666666; ^ M border-left:1px solid # 666666; ^ M} ^ M solution:

1, delete with the sed command

# sed-I's /\ rUnigram g' filename

2. After opening the file with vim,vi

After reading this, the article "how to delete the end of a line in vim" has been introduced. If you want to grasp the knowledge points of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Documents articles content proper one line usage methods commands ideas file names new knowledge more steps knowledge knowledge points articles details industry information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Technology MariaDB Huawei Docker