Vim Learning Accumulation (i)

Source: Internet
Author: User

The first is a simple understanding of the three states (which are generally accepted as patterns), namely: Insert, view, and general.

After entering vim, the default is the general mode, when the direct use of ' a ', ' I ', ' o ' (that is, enter the vim after the direct press of the A/I/O key can enter the insertion mode.)

The difference is that a command moves the cursor back one character and then into insert mode. I is directly into the insertion mode and the cursor position is unchanged. o The other cursor jumps directly to the beginning of the next line in the current row.

Entering view mode from normal mode is directly pressing the V button, and trying to use the mode is not very familiar.

The way to return to normal mode from insert mode and view mode is to press the ESC key. This shows that when using VIM, you need to press the ESC key frequently (it should be possible to change the key).

Here are some of the commands you use frequently (the following commands must be used in general mode):

To delete the current line (that is, the line where the cursor is located), go back to normal mode and press the D key two times (both uppercase and lowercase). In addition, NDD (n indicates a number, such as 23, 56, and so on) can delete the n rows starting at the cursor (including the row of the cursor and the number of seconds).

When we accidentally delete certain lines, we can use ' u ' to recover. U command is a time to undo the previous operation, the middle of the save operation is OK, you can revert to this time the file opened state.

Also x key, X can directly delete the character of the cursor.

Vim Learning Accumulation (i)

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.