Vim shortcut keys

Source: Internet
Author: User

A. Mobile:
H,j,k,l: Left, bottom, top, right.
W: The first word of the next word.
E: The ending of the next word.
B: The word head of the previous word.
<&gt: Indent when v mode is selected.
Two. Jump:
%: Can match {}, "", (), [] jump between.
H, M, L: Jumps directly to the top, middle, and bottom of the current screen.
#H: Jumps To line # of the current screen.
#L: Jumps to the bottom # line of the current screen.
ZT: The current edit line is placed on top of the screen.
ZZ: The current edit line is placed on the screen.
ZB: The current edit line is placed on the bottom of the screen.
G: Jump directly to the bottom of the file.
GG: Jump to the top of the file.
(): Jumps to the current beginning and end of line.
{}: Jumps up and down to the nearest empty line.
[{: Jump to the beginning of the current chunk.]
]}: Jumps to the end of the current chunk.
0: Jump to the beginning of the line.
$: Jumps to the end of the line.
2$: Jumps to the end of the line at the next line.
#: Jumps to the first # position of the line.
#G: 15G, jump to line 15.
: #: Jump to # line.
F ' n ': jumps to the next "n" letter.
Ctrl+b: Turn back one page.
Ctrl+f: Turn one page forward.
Ctrl+u: Turn back half a page.
Ctrl+d: Turn half a page forward.
Ctry+e: Scroll down one line.

Three. Select:
1.V: Select a row.
2.^v: Rectangle selection.
3.V3W: Select three characters.
Four. Edit:
1. Add:
I: Insert before cursor.
I: Inserted at the beginning of the current line.
A: Insert after cursor.
A: The current line end is inserted.
O: Insert a new row before the current line.
O: Inserts a new row after the current line.
2. Modify C (change) as the main:
R: replaces the character at which the cursor is located.
R: Replaces the character where the cursor is located.
CW: Changes the word-to-tail at the cursor location.
C#W:C3W modifies 3 characters.
C: Modify to end of line.
CI ': Modifies the text content in the paired punctuation.
Di ': Delete the text content in the paired punctuation.
Yi ': Copy the text content in the paired punctuation.
VI ': Select the text content in the paired punctuation.
S: replaces the character at the current cursor.
#S: Delete the # line and replace it with the new text.
3. Delete main:
D: Delete to the end of the line.
X: Deletes the previous character in the position of the cursor every time it is pressed.
X: Every time you press the cursor, delete the following character at the location of the pointer.
#x: Delete the 6 characters after the cursor position.
d^: Delete to the beginning of the line.
d$: Delete to the end of the line.
DD: (CUT) deletes the line where the cursor is located.
DW: Deletes the remainder of the word after a word/cursor.
D4W: Delete 4 word.
#dd: Deletes the # line starting at the line where the cursor is located.
DaB: Deletes the contents of {} and within it.
DiB: Delete the contents of {}.
N1,N2 d: Removes the content between the n1,n2 rows.
4. Find:
/: Enter keywords, find not to find, directly press N, search backwards until found.
?: Enter the keyword and find it is not looking, just press N and look forward until you find it.
*: Find the same word backwards on the current page.
#: Finds the same word forward on the current page.
5. Copy y (Yank) mainly:
YW: Copies the characters from the cursor to the end of the word into the buffer.
#yw: Copies the # characters to the buffer.
Y: Equivalent to YY, copy the entire line.
#yy: Represents the number of lines of text that is copied from the line where the cursor is located.
P: Paste. All operations related to Y must be combined with p to paste.
N1,N2 CO N3: Copy the contents of line N1 to section N2 to the N3 line.
6. Case conversion:
GUU: Changes the current line's letter to uppercase.
GUU: Changes the current line's letter to lowercase.
GUW: Changes the word under the current cursor to uppercase.
GUW: Changes the word under the current cursor to lowercase.
A. Whole capitalization:
Gggug
GG: The first character of the cursor to the file.
Gu: The selection range is all lowercase.
G: To the end of the file.
B. Entire lowercase: gggug
7. Other:
J: The current line and the next line are merged into one line.
8. Move:
N1,N2 m N3: Move the contents of the N1 line to the N2 row below the N3 line.

Five. Exit:
1. W FileName: Save the file being edited filename
2. Wq FileName: Exit the file you are editing after saving filename
3. Q: Exit does not save.

Six. Window operation:
1. CTRL+W p: Switch back and forth between two split windows.
2. Ctrl+w J: Skip to the split window below
3. Ctrl+w h: Jumps to the left split window.
4. Ctrl+w K: jumps to the upper partition window.
5. Ctrl+w L: Jump to the right side of the split window.

Vim shortcut keys

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.