The most common commands in vim

In fact, many of the vim usages introduced in the book are not used very much. Here, the most commonly used commands are introduced as notes for easy query.

General mode:

Number 0: move to the first character of the line

$ : move to the last character of the line

G : move to the last line of the file

gg: move to the first line of the file

n<Enter>: move the cursor down n lines

/word search down ?word search up Press n to continue searching Press N to search backwards

dd: delete the entire line where the cursor is located

ndd: delete n lines down

yy: Copy the line where the cursor is located

nyy: copy the line where the cursor is located n lines down

p: paste to the next line of the cursor P: paste to the previous line of the cursor

u: undo operation

ctrl+r: repeat the previous operation

. : repeat the previous action








Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325476437&siteId=291194637
Recommended