The difference between VI and VIM

Source: Internet
Author: User
Tags save file

They are multi-mode editor, the difference is that Vim is the upgrade version of VI, it is not only compatible with all VI directives, but also some new features inside.

These advantages of vim are mainly reflected in the following aspects:
1. Multilevel undo
We know in VI, press u can only undo the last command, and in Vim can be unlimited undo.

2. Ease of Use

VI can only run on Unix, and vim not only runs on Unix,windows, Mac and other multi-operating platforms.

3. Syntax highlighting
Vim can use different colors to highlight your code.

4. Visual operation
This means that VIM can be run not only at the terminal, but also in X window, Mac OS, Windows.

5. Fully compatible with VI
In some cases, you can use Vim as VI.

VI and VIM are all editors in Linux, the difference is that vim is more advanced, can be regarded as the upgrade version of VI. VI is used for text editing, but Vim is more suitable for coding.

VI has 3 modes: insert mode, command mode, low line mode.

Insert mode: You can enter characters in this mode and press ESC to return to command mode.
Command mode: You can move the cursor, delete characters, and so on.
Low-line mode: can save files, exit VI, set VI, Find and other functions (low-line mode can also be seen as a command mode).

One, open file, save, close file (used in VI command mode)

VI filename//open filename File
: w//Save File
: w vpser.net//Save to Vpser.net file
: Q//Exit editor, if the file has been modified please use the following command
: q! Exits the editor without saving
: Wq//Exit editor, and save file

Second, insert text or lines (vi command mode to use, after executing the following command will enter the insertion mode, press ESC to exit the insertion mode)

A//Add text to the right of the current cursor position
I//Add text to the left of the current cursor position
A//Add text at the end of the current line
I//Add text at the beginning of the current line (the beginning of a non-empty character)
O//Create a new row above the current line
O//Create a new row below the current line
R//replace (overwrite) the current cursor position and several subsequent text
J//Merge cursor row and next line of behavior (still in command mode)

The difference between VI and 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.