Learn from the Linux learning of Brother Bird (9)--vim Program Editor

Source: Internet
Author: User

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

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.