Basic operation of Vim

Source: Internet
Author: User

vim Normal mode, insert mode, command mode switchVIM open, cursor Movement, edit mode, normal mode, command mode toggle command

The cursor can be moved in the screen text using either the left or right arrow keys on the keyboard or the HJKL letter key.

H (Shift left) J (downlink) K (upstream) L (shift right)

Use the HJKL letter key must ensure that Vim is in normal mode, if it is input mode, the letter key will not be used. Press the ESC key to return to normal mode.


When you want to enter the VIM editor input: Vim file name < Enter >

How do I get into insert mode?
    • A insert the content after the cursor
    • A inserts the content at the end of the line where the cursor is located
    • I insert content at cursor location
    • I
    • s removes the character at the cursor and then enters insert mode
    • S
    • CW Delete the character from the cursor position to the end of the word before entering insert mode
    • o Enter insert mode below the line where the cursor is located
    • O Enter insert mode on the top of the line where the cursor is located

In normal mode, start inserting text at the cursor position.

Input I enter the necessary text.

Enter lowercase o to open a new line below the cursor and place the cursor at the beginning of the new opening and into insert mode.

Enter an uppercase O to open a new line above the cursor and place the cursor at the beginning of the new opening and into insert mode.

Enter lowercase A To insert text after the cursor position. Enter uppercase A to insert text after the end of the line in which the cursor is located.

Exit edit mode back to normal mode press <ESC>

To exit the Vim editor, go back to Normal mode, enter:: (the second colon is keyboard input) back to command mode, enter the following command at this time:

<ESC>: q! < Enter > here the colon is required to enter, this is not saved modified exit mode

Or, enter the following command to save all changes:

<ESC>: Wq < Enter > or: x, where the colon is required

Basic operation 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.