Tag: Use the AR string of the strong file app
* Locate the specified row N:
Enter "NG ".
Or enter "ngg ".
Or enter ": N"
Here, n is the row number of the specified row. Note that sometimes G = GG.
* Jump to the top of the screen:
Enter "H ".
This is the first non-empty character. Adding a number N indicates the number of rows (such as the N row of the 'nh 'positive number) from the top of the window)
* Jump to the bottom of the screen:
Enter "L ".
This is the first non-empty character. Add a number to indicate the number of rows at the bottom of the window (for example, the nth row at the bottom of 'nl)
* Jump to the center of the screen:
Enter "M ".
This is the first non-empty character.
* Jump to the beginning of the file:
Enter "GG ".
* Jump to the end of the file:
Enter "G ".
* Move the cursor to the end of a sentence:
Enter ")".
* Move the cursor to the beginning of the sentence:
Enter "(".
* Move the cursor to the beginning of the paragraph:
Enter "}".
* Move the cursor to the end of the paragraph:
Enter "{".
* Jump to the end of the row:
Enter "$ ".
* Jump to the beginning of the line:
Enter "^ ".
Or enter "0 ".
Here, '^' is the first non-blank character to be moved to the beginning.
* Backward jump to the end of the word nearest to the entire file:
Enter "E ".
* Forward to the header of the word nearest to the entire file:
Enter "B ".
* Jump to the next word header of the entire file:
Enter "W ".
** Intra-row Movement
You can add the number N prefix to indicate that the number is moved n times (for example, '3fc 'indicates that the 'fc' is executed three times .)
* Move to the back of the first character C on the right of the cursor:
Enter "FC ".
* Move to the front of the first character C on the right of the cursor:
Enter "Tc ".
* Move to the front of the first character C on the left of the cursor:
Enter "FC ".
* Move to the end of the first character C on the left of the cursor:
Enter "Tc ".
* Repeat the previous F, T, f, and t commands:
Enter ";".
For example, if it is 'fc ', input'; 'is equivalent to 'fc '.
* The previous F, T, f, and t commands are repeated in the opposite direction:
Enter ",".
For example, it was just 'fc ', input', and 'equivalent to 'fc '.
**
** Moving in a long row:
Here is a small convention: if a long line occupies multiple rows on the screen, we call this line "long rows" and a line on the screen "screen rows ". Therefore, for a 'long line', you need to have multiple 'screen line' to display.
* Move to the next "screen line" in "long line ":
Enter "GJ ".
* Move a long line to the previous screen line ":
Enter "GK ".
* Move to the beginning of the current screen line in "long line:
Enter "G ^ ".
* Move to the end of the current "long line" screen line:
Enter "G $ ".
Here, if a row exceeds the screen width, it is displayed in multiple rows on the screen. Although multiple rows are displayed, it is actually one row, when the input is moved up or down, although it is in the last or next line, it is usually displayed in the screen to skip n rows. G $, G ^, gj, and GK are useful when the length is exceeded. J and K move a line in the text. When the length of a line exceeds the line on the screen, J and K may move multiple lines on the screen. At this time, you can use Gj and GK to move a line of the screen instead of a line of text. Similarly, G ^ and G $ are the beginning and end of the line on the screen, rather than the end of the line on the text.
**
* Jump to the 50% object by percentage:
Enter "50% ".
Here, % is used to redirect by percentage. If you want to jump to 75%, enter "75% ".
** Page flip
It can be a multiple of execution with the numeric prefix n. You can use [Pageup]/[Pagedown] to flip pages.
* Flip down:
Enter "[CTRL] F ".
* Page up:
Enter "[CTRL] B ".
* Flip down half page:
Enter "[CTRL] D ".
* Half page up:
Enter "[CTRL] U ".
**
** Page flip relative to the cursor
The result is that the row is rolling in the corresponding direction, and the cursor is still in the original row, as if to drag the text.
* Move the cursor to the top of the window in the row:
Enter "ZT ".
* Move the cursor in the middle of the window in the row:
Enter "ZZ ".
* Move the cursor to the bottom of the window in the row:
Enter "ZB ".
* Roll row n to the top of the screen:
Enter "NZT ".
* Roll row n to the bottom of the screen:
Enter "NZB ".
* Roll row n to the center of the screen:
Enter "NZZ ".
**
* Set bookmarks:
Enter "Ma ".
In this way, a bookmark is marked at the current cursor position and its name is. Only lowercase letters are allowed. You can't see the existence of bookmarks, but it is already there. Only bookmarks in the current file can be recorded. The bookmarks will not be retained when you exit Vim again. The bookmarks are only a location in the current file. However, after the bookmarks are set, save the file and save the bookmarks.
* To bookmarks:
Enter "'a ".
Note: This is not a single quotation mark. It is generally located on the left side of 1 of most keyboards.
* To the row where bookmarks A are located:
Enter "'a ".
The single quotes are used to jump to the row where the bookmarks are located.
* To the last file Edited:
Enter "'.".
This command is useful, and you do not need to mark it yourself. Note that the quotation marks are entered here, which is accurate to the point.
* To the row where the last edited file is located:
Enter "'."
Note that the rows are accurate and the quotation marks are entered '.
* Return to the position returned by the last insert status:
Enter "'^ ".
Or enter "'^ ".
Here '. accurate to the row,'. accurate to the point (row + column ).
* View the list of all current bookmarks:
Enter ": marks ".
** Search:
* Search for a string:
Enter "/string ".
Here, "string" is the string to be searched and will automatically jump to the first "string" behind the cursor.
* Forward search based on the last search:
Enter "N ".
* Backward Search Based on the last search:
Enter "N ".
* Reverse search for a string:
Enter "?" String ".
Here, "string" is the string to be searched and will automatically jump to the first "string" before the cursor. The ": N" and ": N" commands used later are in the opposite direction.
* List the search history records:
Enter "Q /".
Or enter "Q? ".
This will open a new window at the bottom of the vim window to list your search history records.
* Match exactly the words under the current cursor downward:
Enter "*".
Then, you can press 'n' to continue searching.
* Completely match the words under the current cursor up:
Enter "#".
Then, you can press 'n' to continue the search.
* Match the string containing the current cursor word downward:
Enter "G *".
* Match the string containing the current cursor word upwards:
Enter "G #".
**
* Jump to the matching half of the brackets:
Enter "% ".
In this way, you can find matching parentheses, that is,),], and}.
* Open the file under the current cursor word:
Enter "gf ".
Here, we assume that the current cursor is above the corresponding file name, such as "Main. c.
* Switch to the last opened file:
Enter "[CTRL] ^ ".
Here, for example, if we enter GF to enter a file, you can enter [CTRL] ^ to return to the file just now. This command can only switch between the current file and the previous file, but cannot move back multiple steps.
* Move back to a previously viewed location:
Enter "[CTRL] O ".
Popular text editors usually have the forward and backward functions, which can move back and forth between locations that have been browsed in files. Enter "[CTRL] O" multiple times in VIM to run the command back.
* Move forward to a previously viewed position:
Enter "[CTRL] I ".
Or enter "[Tab]".
In this way, if the execution is backward, input "[CTRL] O" multiple times in VIM to execute forward.