Vim's frequently used shortcut keys

Source: Internet
Author: User
VIM +n filename: Cursor positioned to nth row of filename
Shortcut keys:
J Move Down, K move up, H shift, L move right, ctrl+f or pageup up one screen, ctrl+b or pagedown down one screen.
GG moves to the first line, and G moves to the last row.
NG, move to Nth row.
X, delete one character backwards, X, delete one character forward
NX, removing n characters backwards
DD, delete/cut the row
NDD, delete/cut rows up to a total of n rows
DW, deleting the string after the cursor
YY, the copy cursor is in the row
p, paste down, p, paste up
Nyy, where rows are copied down n rows
U, restore previous action (up to 50 times)
V, moving the cursor after pressing V will select the specified character
Ctrl+r, undo the operation of U
I, inserted in the current word match either, I, at the beginning of the line where the cursor is inserted
A, inserted at the current word specifier, a, at the end of the current line
O, insert in next line, O, insert on previous line
/, followed by the string to find, press N to search backwards
? , followed by the string you need to find, press N to search forward
: n1,n2s/word1/word2/g, find word1 between n1,n2 rows and replace with Word2, and no G replaces only the first word1 of each row
: 1. $s/word1/word2/g, replace all word1 in the document with Word2, and no G replaces only the first word1 of each row
: Set NU Displays line number
: Set Nonu does not display line numbers

Vim's frequently used 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.