First, Introduction
Vim is an enhanced version of VI. Vim is the main editor on the Linux platform. Basically all of the documents are added, modified, saved and need to be used. Therefore, it is necessary to master vim.
The installation of Vim is very simple and a single command is available:
Yum-y Install vim-enhanced
The operation of Vim is performed in three modes. They are: General mode, command mode, edit mode. In the general mode we can move the cursor, file copy and paste operations. In command mode, we can save files, exit, and find replacements. Write and modify files in edit mode.
The configuration file for Vim is in:/ETC/VIMRC. We can modify some of the vim configuration here.
Next we introduce the three modes of vim for each.
Second, the general mode
The main operations in general mode are:
2.1 Cursor Operation
Where h,l,k,j can be used in conjunction with numbers. For example, 3h means to move the cursor three characters to the left.
2.2 File Editing commands
Third, enter the editing mode
The way to enter edit mode from General mode is:
Four, command-line mode
Command-line mode typically begins with:
About the command: WQ, actually the command: X is very similar to its usage. These two functions are the same after the normal modification of the file. But if you just opened the file with vim, use: Wq will modify the file's Mtime, and: X will not.
V. Exercises and Answers
Linux Learning (16) VIM