Learn how to use the VIM Editor

Source: Internet
Author: User
Learn how to use the VIM Editor-general Linux technology-Linux programming and kernel information. The following is a detailed description. The text editor VIM on the command line interface is unfamiliar. Although it has been used in DOS before, it feels completely different. In addition, many people in the Forum highly praised VIM, which made me curious and want to understand it and see what it is.

If you search for VIM, there will be many articles such as the VIM user guide.

The VIM editor has two modes: Command mode and input mode.

In command mode, you cannot enter a specific command to perform specific operations on the file. When VIM is started, the command mode is entered by default. There are two types of commands. One is a command similar to a shortcut key. I think this command is actually a shortcut key, and you can press the corresponding key to implement the corresponding functions, for example: press the I key to switch to the input mode. Press the key to insert the cursor from the position where the cursor is located, and press A (shift + a) to insert the cursor from the end of the column where the cursor is located. Note: a and A are two different commands, and the other is the command for typing commands. Most of these commands are entered in the command mode ":", and the cursor appears at the bottom, after ":", enter the corresponding command and press enter to implement the corresponding functions. For example, enter: wq press enter to save the file, exit the VIM editor, and enter: syntax on to enable syntax brightening.

In the input mode, there is nothing to say, that is, the input content. The default input method is insert. The text in VIM is formatted in rows, columns, and words. After pressing g ctrl + g in command mode, the column, row, word, character, and byte position of the current cursor are displayed. A line ends with a carriage return, rather than a line that automatically wraps a line within the display range of the screen. This concept must be clear.

After clarifying this, you will become familiar with various commands and operations, and get used to its editing methods. Then we can explore more powerful kinetic energy. You can use VIM to write programs.
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.