1. Enter Command mode. Vim's command mode is to enter ":" in edit mode, and the cursor jumps to the last line of the screen, where the colon is displayed, and the command mode is entered.
The contents of the command mode are displayed on the last line of the screen, press ENTER, and VIM executes the command.
2. Enter the following characters in command mode: input:%s/^m$//g
3. Enter. All ^m characters in the file are automatically deleted.
Delete line trailing spaces command::%s/\s\+$//
What exactly does this command mean? % refers to match the entire file, S is the meaning of the permutation, ^m note to use CTRL + V CTRL + M to enter, M after the $ represents the match of the end of the content, and the last G will mean that each row in the matching content to be replaced. Understand the meaning of the command, it is good to use, for example, to replace the vim in a file into vim, you can use this command::%s/vim/vim/g.