Use of the VIM editor

Source: Internet
Author: User

 

Vim working mode (diagram)

650) this.width=650; "title=" 1.png "alt=" 1.png "src=" http://ask.apelearn.com/uploads/questions/20161121/ Af81c577bb73dc91582301c824210ebb.png "/>

Vim three modes: Command mode, input mode, last line mode

Command line mode: Control cursor movement, can delete, copy, paste and so on text

Input mode: In general mode can be deleted, copied, pasted and so on, but cannot edit the contents of the file

Last-line mode: In this mode, you can provide the action of your search data.

In the last line mode:

: Q #退出

: q! #强制退出, discard the modifications made

: Wq #保存退出

: x #保存退出

Command mode

ZZ: Save Exit

ZQ: Do not save exit

Command mode cursor jump

1. Jump between characters

H: Left L: Right J: down K: Upper

2. Jump between words

W: The beginning of the next word e: The ending of the current or next word

B: The first word of the current or previous word

3. Beginning line End Jump

^: jumps to the first non-whitespace character at the beginning of a line

0: Jump to the beginning of the line

$: Jump to end of line

3. Move between rows:

G: Last line

1G,GG: First line

Replace command (R,replace)

R: the character at which the cursor is replaced

Delete command:

D: Delete command, can be used in conjunction with the cursor Jump command, to achieve range deletion

For example: DW Deletes a word, DG deletes the current cursor line to the last row

d$: Delete to end of line

D0: Delete to the beginning of the line

DD: Delete the line where the cursor is located

#dd: Multi-line deletion

Copy command

Y: Copy yy: Copy entire row

Paste command (p,paste)

Flip Screen operation

CTRL+F: Flip a screen to the end of the file

CTRL+B: Flip a screen to the file header

Ctrl+d: Turn half screen at the end of the file

Ctrl+u: Turn half screen to file header


Use of the VIM editor

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.