"/" is the VI Editor's Mode search command. When you type/, a line appears at the bottom of the screen, and a diagonal shoulder appears at the beginning of the bottom line, and the cursor is placed after the tilt. At this point, you can type the pattern you want to search at the cursor position. After you enter the completion and press ENTER, the editor will begin searching for the pattern you typed from the cursor's location to the end of the file. If the input pattern is found, the cursor will remain on the found pattern. After you find a matching pattern, use the command "n" If you need to search for the next matching pattern, or use the "n" command if you need to find the last matching pattern.
In addition, the "?" command is also a pattern search command. and "/" is the difference between/is from the cursor when
The previous location searches for the end of the file, and the "?" Command searches the file head for the current location of the cursor.
Text substitution operations require the use of a last-line pattern, which means that all text substitution operations commands start with ":".
The format of the text substitution command is:
: S/TEXT1/TEXT2 is used to replace the first "text1" That is searched for the paragraph where the cursor is located with the "Text2";
: s/text1/text2/g is used to replace all "Text1" in the paragraph where the cursor is positioned with "text2";
: m,ns/text1/text2/g is used to replace all "text1" searched to Text2 from the beginning of the M line to the end of n rows. You can use $ to represent the last line, which means "1,$" to replace all eligible characters in the document.