Search to Navigate
Another way to quickly locate somewhere in Vim is to search for word using the symbol/followed by word you want to search, as follows:
It can be seen that multiple matches are displayed after the command is executed, and we can use n
or N
command to move the cursor to the previous or next occurrence.
Operate with a Search Motion
Similar to the F command, we can combine operation commands and move commands (called in vim for the search command to move the command, because moving the cursor, the previous F command is also a move command), to quickly manipulate an area of text, such as delete or modify.
We entered the visual mode in normal mode v
, we can understand the selection mode, you can select the text. The current position is on the first letter of the takes, after entering the command /ge
, the cursor moves to get's first letter G, the selection extends from the takes T to the get's G, the input h
, the cursor moves to the left, the selection narrows to the space in front of G, enter the d
command , the characters in the selection range are removed.
The above command can also be executed with the following command.
Enter the command first d
, and then determine the extent of the deletion.
[Practical.vim (2012.9)]. Drew.Neil.Tip50 Study Summary