Vim Delete ^ m

Source: Internet
Author: User
1. Enter the command mode. In the command mode of VIM, enter ":" In edit mode. The cursor jumps to the last line of the screen and displays the colon. Now the command mode is started.

The command mode is displayed on the last line of the screen. Press enter and run the command in vim.

2. Enter the following characters in command mode:: % S/^ m $/g

3. Press enter. All ^ m characters in the file are automatically deleted.

Run the following command to delete spaces at the end of a line: % S/\ s \ + $ //

What exactly does this command mean? % Indicates matching the entire file. s indicates replacement. ^ m Note: use Ctrl + V Ctrl + m to input. $ after M indicates matching the content at the end of a line, the final G indicates that all matched content in each line must be replaced. After understanding the meaning of the command, you can use it as a work und. For example, if you want to replace all Vim in a file with vim, you can use this command:: % S/Vim/g.

 

Vim Delete ^ m

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.