1. Under Linux is also programmable, oh, using the VIM program editor, if you learn to use VIM and can read a vim program, it is very much. Before introducing VIM, we will first learn about his predecessor VI. VI has three modes: General mode, edit mode, and instruction column command mode. Between the three are such conversions:
2. Generally open a VIM program to enter the general mode, and then enter o,o,a,a,i,i,r,r any one in the editing mode, and then the bottom left will appear insert or replace. To return to normal mode, you must press ESC to exit edit mode. In general mode, you can move the cursor to the bottom line by entering either:
3. Enter VI test directly to enter the VI interface, the program name is test
4. After editing to exit, press Q, if you want to save, enter Wq, generally recommended to use wq! Indicates that the save is forced to exit, which is entered in the Instruction column command line. If you want to enter your own string in the file, you must wait until insert or replace appears in the lower-left corner.
5. Also for readability, enter set Nu to set the line number, set Nonu to cancel the line number.
6. In fact, when we are editing the file, for example, the editor/etc/man.config,vim will actively establish a temporary archive of the file, suffix SWP, so as to facilitate the sudden exit of the unsaved situation occurs. If your previous VIM operation has not yet been saved, simply press R, which means using the recovery project, the system will automatically load the contents of the temporary archive.
7. Since it comes to vim, the following is a brief introduction of the difference between him and VI, in fact, the function is more perfect. Vim has the color display function, also supports many program syntax, moreover he also has the program debugging function Debug OH
Learn from the Linux learning of Brother Bird (9)--vim Program Editor