Usage of Vim

Source: Internet
Author: User

How to enter insert mode from command mode:

#A/a/o/o/i/i

I: Lowercase is the first letter in the position where the cursor is inserted

I: Uppercase is inserted at the beginning of the line where the cursor is located

A: Start inserting the next letter at the cursor position

A: Insert at the end of the line where the cursor is located

O: The next line where the cursor is located starts inserting

O: The previous row of the cursor line starts inserting

Whether small o or Big O is the cursor another line

Command mode:

X: Delete a single character

U: Delegate undo Undo

DD: Deletes the line where the cursor is located. ---this deletion is actually cut

3DD/D3D: The next three lines, including the cursor

YY: The copy cursor is in the row

P: You can copy and paste the content and paste it on the next line in the row where the cursor is located

Uppercase P: Paste on the previous line of the row where the cursor is located

Paste three lines 3yy/y3y: Copy three lines including the cursor.

GG: Switch to the beginning of the line immediately

G: Just switch to the end of the line immediately.

3g: Just switch the cursor to the third line immediately

R: means replacing one character

R: denotes infinite substitution character

Last-line mode:

: Set number either marks the line or is abbreviated as set Nu

: Set Nonumber

: W Write

: Q quit

: X

How to find in vim:

Like what:

/good----Find good, n switch to the next n switch to the previous,/search for something that is not clear highlighting

: 1,3s/good/guy/g 1-3 Line replace all found good into guy

: 1, $s/good/guy/g all lines replace good change to guy.

crtl-v/Capital V and lowercase v------visualization attempt, block-style Delete

VIMTUTOR--VIM Tutor Guide

P.S.

How to turn on Vim line number global display:

Vim/root/.vimrc

Set NU-----Turn on global file line number display

Or VIM/ETC/VIMRC, plus the following line.

Set Nu


Usage of Vim

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.