VIM Common Commands

Source: Internet
Author: User

1, when the VI is opened by default command mode, to enter the input mode, you need to press A or I key.

Command mode:

: Wq Save and exit

: W only save does not eject

: Q Do not save exit

: q! Do not save forced exits

: wq! Save and Force exit

2 . Find

In command mode, enter/xxx, you can find the XXX

3, Fast switch line

In command mode, you can quickly switch to num lines by entering: num

4, set the display line number

In command mode, enter: Set Nu to display line numbers

Note: Setting does not display line numbers, Command mode input: Set Nonu

Set the permanent display line number, you need to modify the VI configuration file. Open the configuration file for VI ~/.VIMRC, where you can enter set Nu.

5, row Delete

Command mode, first move the cursor to the row to be deleted, enter DD

To delete contiguous rows, such as deleting contiguous 3 rows, use 3DD

6, line copy paste copy

Command mode, Nyy

To place the cursor on the first line of multiple rows when copying

7. Paste

Command mode, p

Paste to the next line in the row where the current cursor is located.

VIM Common Commands

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.