(25)Vim 1

1. Install Vim

  CentOS system, use the following command to install Vim:

  yum install vim

  Note that this command is run, may require manual acknowledgment [y / n]

  Encounter this situation, select the "y" can be.

  If you want to manually enter the process of "y" is omitted, it is desirable automatic installation, this command may be used as follows:

  yum -y install vim

  When the command line, type the following tips vim, the installation is successful

  

2. Recommended reason for using Vim text editor:

  • Almost all Linux distributions are embedded Vim text editor and other editors will not necessarily exist;
  • In the course of using the Linux system, many editing software interfaces are called by default Vim text editor, such as crontab, Visudo, edquota commands;
  • Vim has the ability to edit the program, will take the initiative to use a different font color discrimination grammatical correctness, easy programming;
  • Use Vim text editor, edit faster.
  • Vim is a Vi development and evolution of the text editor because of its syntax highlighting, multi-window editor, code folding, support for plug-ins and other functions, it has become a large  Linux  distributions as standard.

3.Vim three operating modes (command mode, input mode and edit mode) Detailed

  1) Vim command mode

  When using Vim to edit a file, the default is in command mode. In this mode, use the arrow keys (up, down, left, right) or k, j, h, i the position of movement of the cursor, the contents of the file can be copied, pasted, replace, or delete operation.
  2) Input mode Vim is
  in input mode, Vim can write to the file is executed, similar to the type in the document Windows system.

  It makes Vim input mode is typing in the command mode state i, when the file finishes editing press Esc to return to command mode.
  3) Vim editing mode
  editing mode for carrying out the preservation of the contents of the specified file, find or replace operation.

  Vim switch to edit mode so that the method is in the command mode state, press ":" button, then the bottom left of the Vim window appears a ":" symbol, which is can be operated enter the relevant instruction.
  After the instruction execution Vim automatically return to command mode. If you want to return directly to the command mode, press Esc to.

 

Guess you like

Origin www.cnblogs.com/xinghen1216/p/11310260.html