A summary of the VIM text editor

Source: Internet
Author: User

Speaking of the text editor, you have to say that the vim of the old age, say, but also Hale, still have a lot of advocates. It is true that vim is practical, and the advantages of VI are listed first.

1, if the master of vim, you can save the mouse.

2, Vim is a cross-platform editor, and is the default editor of Liunx, Unix

3. Compatible with all VI commands

To master the VIM editor, you must first understand the command mode in Vim, the following is the 3 command mode of VIM:

1, edit mode: Popular point, that is, you want to edit the text, enter text.

2, Visual mode: For text operations, such as: Copy a row, delete a row, etc. (cannot use the keyboard to write text)

3, Command mode: Can be found, replace, delete and other functions

To enter the editing mode of the steps:1, hands to Idle point, more press a few times ESC. 2, press the I key or a built.

Edit mode no commands, only, input text, what you hit on the keyboard, Vim shows what, simply said to use the window of the writing.

To Enter the visual mode:1, more than a few times esc, as a rule, once is enough.

Commands used in Visual mode:

GG: Back to the top of the page

G: Skip to the end of the page

DD: Delete the line where the cursor is located

2DD: Delete the row and the next line where the cursor is located, and 2 is the number is a word definition

YY: The line where the cursor is copied

Enter the command mode step:1, press the ESC several times. 2, then press the combination key: shift+:

Commands used by command mode:

S/old/new/g: Replace the old string of the file with the new string

2,20s/old/new/g: Replaces all old strings in line 2nd through 20 of the file with the new string

  Set Nu: line number will appear

Set Nonu: The line number that already appears will be canceled

The above summarizes how to use vim, more specific commands also need to search the Internet. Just search: Vim's command. Then, the distance mastery is not far away.

A summary of the VIM text 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.