VIM Basic Command

Source: Internet
Author: User
VIM Basic Command

Occasional Updates

Insert operation

I normal insertion
A prompt insert from the next character
o Insert from Next line
I insert in the bank first
A at the end of the bank insert
O insert a new line at the cursor

Delete operation

x Delete the character of the cursor
NX removes the following n characters
DD is used to delete the bank
DG deleted to end of text
D Delete to end of line

Copy and paste

YY Copy Bank
Nyy copy starts from the bank n rows down
DD Cut
P Paste Down
P Paste Up

Single-character replacement recovery

R replaces the current character
R start replacing to ESC
U cancel up-step operation

Move operation

GG to First line
G to last line
Ng/:n to the first few lines

Replace and find

/string finding characters related to string
Search ignores case: Set IC
n searches for the next specified string
:%s/old_str/new_str/g Full Text replacement
: n1,n2s/old_str/new_str/g Range Replacement

Save exit

: Wq Save Exit
: W Save changes
: W New_file Save As
ZZ Save changes and exit
: q! Do not save exit
: wq! Save changes and eject (file owner and Root available)

Other commands

Cancel Highlight: Noh

VIM Basic Command

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.