3 minutes to learn simple to use Vim

Vim is a run on the command line text editor, which is the standard Linux personnel. In the Windows environment can be particularly useful, for example, create a file without a file name (.gitignore).

Vim function is very powerful that some people fear it is. Today we simply use a text editor vim documentation to see how to perform basic editing operations.

First you have to make sure you have installed Git, after a right-folder, you'll see Git Bash Here (here open Git Bash):

 

Click on it to open Git Bash. Enter vim <file name> to open or create a file. Here we must create a.txt, on vim a.txt:

 

 Press the Enter key, you enter into a famous Vim!

This is something you will find that no matter keys are not used, do not panic, click on the i key to enter insert (insert) mode:

 

 

 At this time you can easily enter text up! Enter key and can move the cursor up and down keys:

 

 Once you have entered, press the ESC key to exit insert mode, you'll find the lower left corner "- insert -" missing:

 

 This is the input: wq, save and exit operations. Of course, you can also perform separately: w (save) and: q (quit) command, which is not affected:

 

 Press Enter, you'll find vim automatically exit, the document also preserved:

 

 This is the basic usage of vim. But the power of vim is not in this, the wealth of shortcut keys, and a large number of plug-ins is reflected in its strong. In any case, learning Vim still need a lot of time. I learned a little bit, with VSCode code or write it (¯ ▽ ¯) ~ *

Guess you like

Origin www.cnblogs.com/lyj00912/p/12629467.html