VIM Basic operation

Source: Internet
Author: User

Several modes of VIM switching

Insert command

Command

Role

A

Insert in the word specifier the cursor

A

Insert at the end of the line where the cursor is

I

Insert in the word match either the cursor

I

Insert at the beginning of the line at which

O

Insert a new line under the cursor

O

Insert a new line on the cursor

Position command

Command

Role

: Set Nu

Set Display line numbers

: Set Nonu

Suppress line numbers

Gg

To the first line

G

To the last line

NG

to Nth row

: N

to Nth row

$

To end of line

0 or ^

To the beginning

Delete command

Command

Role

X

Delete the character at the cursor location

Nx

Delete the n characters at the cursor (including at the cursor)

Dd

Delete the cursor in the row

Dg

Delete the line of the cursor to the end of the file

D

Delete the contents of the cursor at the end of the line

: n1,n2d

Delete the contents of the N1 to N2 line: 1,3 wounds 1 to 3 rows

Copy and cut

Command

Role

Yy

Copy when moving forward

Nyy

Copy the following n rows of the current row (including the current row)

Dd

Cut when moving forward

Ndd

Cut the following n rows of the current row

P,p

On the line where the current cursor is located, paste

Replace and cancel

Command

Role

R

Instead of the character at the cursor, press R again to replace the result

R

To replace a string from where the cursor is located, press ESC to end

U

Undo action from the previous step

VIM Basic operation

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.