Which of the following vim operations can help me explain?
Source: Internet
Author: User
Who can help me explain the following vim operations-general Linux technology-Linux technology and application information? The following is a detailed description. The following content about vim deletion is taken from the network:
: % S = * $ = Delete the blank space at the end of the row
: G/^ s * $/d delete all empty rows
: G/str1/,/str2/d delete all the rows from the first entry containing str1 to the first entry containing str2.
: V/./,/./-1 join compressed empty rows
: G/^ $/,/./-j compressed empty rows
In the first line, I checked vim's help. = is the meaning of the last line of the line number, and there is no "/" after s. I didn't see it clearly.
The reason for deleting all empty rows in the second row is my search. It confirmed it was feasible, but I didn't understand it. I checked it: [range] g/{pattern}/[cmd], execute [cmd] (default: print) for the rows that match {pattern} in the [range ). The problem lies in this {pattern}. I think it should be a regular expression, but does ^ s * $ indicate empty rows? I tried to change it to ^ $. I just don't understand what the original expression means.
The third line is just a bit more understandable. I don't understand the four or five lines. It seems that joinspace is involved, and I don't understand it either. I hope you can help me explain it.
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.