The VIM editor uses

Source: Internet
Author: User

Vim mode:

Edit mode (Command mode) (default)

Input mode

Last-line mode

Mode conversion:

Edit ————) Input:

I: Enter in front of the character where the current cursor is located

A: Enter after the character of the current cursor

O: At the bottom of the current cursor line, create a new row to enter


I: At the beginning of the line where the current cursor is located, enter

A: At the end of the line where the current cursor is located, enter

O: At the top of the line where the current cursor is located, create a new row, enter

Input ———— Edit:

ESC key

Edit ————) Last line:

Input:

You can enter the command at this point.

Delete line Tenth: 10d

Delete line tenth to 20th: 10,20d


Last line ————) edit

ESC ESC


Open File:

Open or modify a file: Vim filename

Open a file and position the number of rows: Vim +12 filename

The cursor is in the last line: Vim + filename

Open the file and navigate to the beginning of the first pattern match: Vim +/pattern filename


To close a file:

In the last line mode:

Q: Exit does not save

Wq: Save exit

q!: Forced exit

W!: Forcibly saved

X and Wq equivalence

In edit mode:

Zz


To move the cursor:

H: Left

L: Right

J: Next

K: Up

#h: Moving a # character

W: Move to the beginning of the next word

E: Move to the ending of the current or next word

B: Move to the beginning of the current or previous word


In-line movement:

Jump to the beginning of the line: 0

Skip to end of line: $

Inline Jump:

#G: Jump To Line #

G: Skip to the last line


Turn screen operation:

CTRL+F: Flip one screen down

Ctrl+b: Turn up one screen

Ctrl+d: Flip Down half screen

Ctrl+u: Flip Down half screen


To delete a single character:

X: Delete a single character at the cursor location

#x: Remove the total # characters from the cursor and backwards


Delete command: D

#d + Jump Range

DD: Delete cursor in the row

. Represents the Forward

., + 10: Delete the current line to line tenth



Paste command: P

P: If you delete or copy the entire line, paste it below the line where the cursor is located, and paste it after the cursor if the copied or deleted content is a non-full row.

P: If you delete or copy an entire line of content, paste it above the line where the cursor is located, and paste it in front of the cursor if the copied or deleted content is a non-full row.


Copy command:

Usage with D


Modify: Delete content first, then convert into input mode

C with d command


Replacement: R


Undo Edit Operation: U

U: Undo Previous Action


Visualization mode:

V: By character selection, you can highlight the selection, with the upper and lower keys, selected can be copied and other operations.

V: Select by rectangle


Find:

/pattern

? pattern




The VIM editor uses

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.