Common methods of Vim in Linux

Source: Internet
Author: User

I current cursor position insertion

A current cursor after insertion

0 Insert from another line

A at the end of the line where the cursor is inserted

I Insert at the beginning of the cursor

: Set Nu Sets line number

: Set Nunu Cancel line number

GG to First line

G to last line

$ move to end of line

0 move to the beginning of the line

Ng to the first few lines

N to the first few lines

X Delete the character at cursor location

NX deletes the last few characters at the cursor location

DD Delete Row of cursor, NDD delete n rows

DG deletes the line from the cursor to the end of the content

D Delete the line from the cursor to the end of the content

%s/old/new/g Full Text replacement

1,3s/old/new/g Specify line number substitution

/string Search N Search the next bar

Set IC is case insensitive

: Save W 2.txt as a file

R Replace cursor position

R always replaces the cursor position until ESC exits

U Cancel the previous action

YY copy

P Sticky Sticker

DD Cut

Common methods of Vim in Linux

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.