Vim Study Notes

Source: Internet
Author: User
Move the cursor
H j k l key:
Number Parameter 4l move 4 characters to the right

Move cursor paragraph
0 beginning and end of $
W moves to the right based on the distance of a word
B moves to the left based on the distance of a word.

I insert the cursor at the current position
I insert at the beginning of a row
A. Check and insert the cursor at the last character.
A Insert at the end of a row

The C command must be combined with a mobile command
CW modification to the end of a word
C2B to the first two words
CC completely modifies the entire line

R
Replace the character of the current cursor
R
In overwriting mode, Press ESC to stop

~
Adjust case sensitivity

D. Delete characters.
DW deletes a word
D $ Delete to the end of the row
Do Delete to the beginning of the next line
Dd deletes a whole row
D $ shortcut

X delete a single character under the cursor
P Paste

Y Replication
Copy a word from YW.
Y $ copy to the end of the row

. Repeat the previous edit operation command.

U undo the last operation
U only revokes the operation of this row. If the cursor is removed, the operation fails.

O create a new row in the next row of the cursor and enter the editing mode
O in the previous line, the others are the same

E to the last letter of the word
E. Same as above, but skipping punctuation marks

INSERT command numeric parameters
25a *-[ESC] add 25 pairs *-

CTRL + F move forward to a screen
CTRL + B Move back a screen
CTRL + D move forward half screen
CTRL + u move half screen

Z [enter] Scroll the current row to the top of the page
Z. Scroll the current row to the center of the page
Z-scroll the current row to the bottom of the page

CTRL + l re-paint the current screen

H move to the first line of the page
M moves to the middle line of the page
L move to the last line of the page
NH moves to the nth row after the first row.
Line n before the last line after NL

[Enter] or + move the cursor to the first letter in the next row
-Move the cursor to the first letter in the previous row.

^ Move to the first non-null character in the current row
N | move the cursor to column N of the current row

(Move to the beginning of the current sentence
) Move to the beginning of the next sentence.

{Move to the beginning of the current paragraph
} Move to the beginning of the next paragraph

[[Move to the beginning of the current chapter
] Move to the beginning of the next chapter

/(Rule) Search for characters in the current file (Backward Search)
? (Rule) Search for characters in the current file (Forward search)

N repeat the previous search

FX searches and moves the cursor to the first character matching N in the row
FX searches and moves the cursor to the first character matching N in the row
TX search and move the cursor to the first character in the row that matches n
TX search and move the cursor to the next character of the first character matching N in the row

; Repeat the previous character search
To repeat the previous character search in the opposite direction.

Ng move the cursor to line N

Edit command combination usage example:

Modify/delete/copy/cursor
CH/DH/YH/top of the processing screen
Cl/dl/YL/Bottom of the processing screen
C + /d +/Y +/process the next row
C5 |/D5 |/Y5 |/process the fifth column of the current row
2c) /2d)/2y) /process the second sentence after
C {/d {/y {/process the previous paragraph
C/pattern D/pattern y/pattern processing rules
CN/dN/YN/process the next rule
CG/DG/YG/process the end part of the file
c13g/d13g/y13g/process 13th lines of text

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.