In the previous article, we briefly listed some basic Vim operations and a lot of cursor movement commands. This chapter mainly describes the commands that can move the cursor faster.
The most commonly used Vim editing operation is to move the cursor. For a few lines of files, basic commands are enough, but in most cases, each file has hundreds of lines, the command to move the cursor is clumsy. For more information about how to move the cursor more quickly, see the following command:
Move cursor with screen as reference
CTRL-F---- Move the cursor down a screen
CTRL-B---- Move the cursor up a screen
CTRL-d---- Move the cursor down half of the screen
CTRL-u---- Move the cursor up half of the screen
Set the cursor relative to the screen position
Z enter---- Move the current row to the top of the screen
Z.----- Move the current row to the center of the screen
Z----- Move the current row to the bottom of the screen
Redraw the current screen CTRL-L (Use Case not quite clear)
Quickly move the cursor inside the screen
H---- Move to the first line of the current screen
M--- Move to the center of the current screen
L---- Move to the bottom of the current screen
[Number]-H---- Move to the opposite line and the first line, down the line [number-1]
[Number]-l---- Move to [number-1] Line Up relative to the last row
Moving relative to rows
+/Enter--- Move the beginning of the next line and ignore the blank/Tab
----- Move to the header of the previous line and ignore the blank/Tab
Move in current row
^---- Move the beginning of the current row, ignore blank/tab (0: Move to the beginning of the current row, but do not ignore blank/TAB)
[Number]-| (vertical line)---- Move to the [number] column of the current row
FAST text Movement
The list part (W, W, B, B) in the previous article. The following command is also a text moving command.
E---- Move to the end of a word
E---- Move to the end of a word and ignore punctuation marks
(/)---- Move to the sentence Header/end (matching? .! + At least one space character/the last character of the row)
{/}---- Move to the beginning/end of a paragraph
[[/] --- Move to the beginning/end of a chapter
Use search to move the cursor
In the previous article, we also talked about basic search commands. Here are some special usage examples.
Delete/modify search results
[D/C] [//?] [Pattern]---- Delete or modify the forward or backward search results
Search for the current row
F/F-Character---- Search for characters backward/forward in the current row
T/T-Character----- Search for characters backward/forward in the current row, and set the cursor before/after matching characters
;----- Repeat the last search
,---- Repeat the reverse execution of the last search
Vim uses ---- moving around in a hurry