Vi/vim use

Source: Internet
Author: User

1. Vim has a total of 4 modes:

  • Normal Mode (Normal-mode)
  • Insert mode (Insert-mode)
  • Command mode (Command-mode)
  • Visual Mode (Visual-mode)

Normal mode

The default is in normal mode when Vim is started. No matter what mode you are in, pressing the <Esc> button (sometimes pressing twice) will enter normal mode.

Insert mode

Pressing I, I, a, a etc in normal mode will enter insert mode. Now just remember to press the I key to insert mode. In insert mode, the corresponding character is written when the key is clicked.

Command mode

In normal mode, press the: (English colon) key to enter command mode. In command mode, you can perform some input and execute some of the instructions provided by VIM or plug-ins, just like in the shell. These directives include setting up the environment, file operations, invoking a feature, and so on.

Common commands are: Q (exit), q! (Forced exit), W (save), Wq (Save and exit).

Visual mode

Press V, V, <ctrl>+v in normal mode to enter the visual mode. Operation in the visual mode is a bit like taking the mouse to operate, select text when there is a mouse to choose the visual sense, sometimes it is very convenient.

Vi/vim use

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.