How to download and use Vim in the first three modes

Source: Internet
Author: User

First of all, it is worth mentioning that the PDF version of my vim tutorial has been completed. You can download it here, which is csdn: Click here to download it. If the download on the left fails, you can also enter the following address in the browser to download: http://download.csdn.net/detail/xinguimeng/7714213, of course, if you are a loyal user of Baidu network disk, you can also use Baidu network disk, I also synchronized upload to Baidu network disk, below: Baidu Network Disk download, if the address is Hung, you can enter in the browser: http://pan.baidu.com/s/1sj9CLXz to download.

First, let's talk about the entire idea. It is divided into the following seven sections, introducing the basic aspects of Vim's application. SECTION 0 is the introduction and download of VIM. The first section is the three modes and the Quick Start of VIM. The second section describes the most commonly used commands and the third section describes the most commonly used operations, the fourth section describes some of the most common configurations. The fifth section describes common batch operations, including macro recording operations. The sixth section describes some tips and experiences, the seventh section is the use of code folding.

This fall edition is my first time writing Vim tutorials. Although it is always difficult to read others' tutorials, it is difficult to write in person, some content always does not know where to put it, so it is very tangled. When I write this tutorial, I also feel that I have learned a lot. In a word: Spread programming knowledge, revitalize Chinese software.

Well, some people divide programmers into three types: Vim for the first type, emacs for the second type, and other development environments for the third type. That's right, Vim, as an artifact, not only has very powerful functions, in addition, it also has enough fans and enough elites around it, just like the stars and the moon. I have heard of VIM for a long time. Since I used it, I found that I can't do without it anymore. In fact, VIM is like this. It's hard to get started, just like Linux. But when you get familiar with it, you will find that you will fall in love with her more and more, because she is so fast. Just like the five-stroke input method, if we don't learn five strokes, we can continue to use sogou, but once we learn five strokes, we don't want to use sogou any more, because the five strokes are too fast. Since Vim is so sharp after use, why don't we spend some time conquering it? Come on, Xin Xing will be the strongest boost to your learning path.

* ******************* VI ***************** Vim **** ******************

1. many people are confused about the three. In fact, these three sources are quite deep. First, VI is the most basic text editor in * NIX operating system, developed by Bill Joy at Berkeley University.

2. vim is written by Bram mooleanaar. It initially functions less than vi, and its name is "VI imitation", that is, VI simulator. However, in 1992, VIM was transplanted to Unix and DOS, and Vim's wildcard NGN completely surpassed VI, so Vim was renamed as "VI improved", that is, VI enhanced version.

3. next, let's take a look at several important versions of VIM. versions 3.0 added the multi-window editing mode, 1996 included the first GUI version, and added the syntax highlighting function, 2001 introduces code folding, plug-ins, multi-language support, Vertical Split windows, and other functions. In 2006, you added spell check, code completion, and Tab editing. Later versions 2008 and 2010 were released in 7.2 and 7.3 respectively. The latest version is 7.4.

4. gvim can be understood as the graphical front-end of VIM. It is a cross-platform editor and maintains the vim style. Since gvim has a GUI, it naturally supports mouse operations, in addition, the Windows version also provides features such as copy, paste, and cut, which are similar to those in windows. Of course, it also supports operations in linux such as "D", "Y", and "p". In general, gvim is an enhanced version of VIM. Here we will use gvim as an example to explain it.

5. We sometimes say that gvim is vim, mainly because Vim is more famous.

* **************************** Download and install Vim ****** *****************

1. it is too easy to install Vim in wiindows. You can search for the gvim download on the Internet. There are a bunch of download operations. I suggest you download vim7.x or a later version. I downloaded Vim 7.4, if the reader is very fond of using my version, you can go to the http://pan.baidu.com/s/1dD4B9vz to download, This is a compressed file, do not install, unzip it directly after you can use it.

2.20.the program runs gvim.exe under the vim74in the folder. You can create a shortcut and put it on the desktop or in the taskbar.

3. Here we will talk about it on Windows.

************************* Three modes ************* ***************

1. some people also fall into two modes, which can be divided into normal mode and insert mode, but I am still used to being divided into three modes, I am afraid that many people who have worked on the win platform for too long may not think of it, because they often do not have the concept of pattern, and even the famous Emacs is not based on the pattern.

2. the first mode is the normal mode, which can be translated into "Normal Mode" or "command mode". In this mode, the keyboard input is executed as a command, for example, I indicates to insert the cursor on the left, a indicates to insert the cursor on the right, and hjkl indicates to move the cursor to the bottom left and the right. These commands will be discussed later.

3. the second mode is the insert mode, which can usually be translated into the "insert mode". In this mode, VIM seems to be the same as most of our editors in windows. What key should we press, some keys are excluded from the display. For example, the ESC key is used to return to the command mode. Some keys are function keys and do not have the function of inputting characters.

4. last line mode is the "bottom line mode". It is mainly used to save files or exit, search, find and replace, set the editing environment, and so on, because its input is also used as a command at this time, therefore, some people have incorporated it into the command mode. It doesn't matter. You only need to know what is going on, so you don't have to get stuck.

**************** ********

1. Many people opened Vim for the first time and found that some of our buttons Vim didn't respond, but were buzzing. Why? Because we are new to VIM, it works in command mode by default. We need to switch to insert mode to input text.

2. Input I in command mode to enter the insert mode. The following is a command in command mode:


Input I on the keyboard. Here I is the first letter of "insert", indicating that the insert mode can be entered. Of course, you can also type A. As you learn more deeply, you will know more and more.

The following describes how to work in insert mode:


Since gvim is used here, You can directly use the "file"> "Save as" of the menu item to save the file, or use the recommended Vim method to save the file, then, Press ESC to switch to the command mode, and then press the colon to determine the line mode, and then enter w D: \ xinxing.txt, as shown below:


Then, press enter to find the following response from VIM:


Now, we have used Vim to complete our first task, which is to write a TXT file and save it. You can find that, all our operations are completed by using the keyboard, without the mouse, which is one of the reasons why Vim is so fast.

That is, using the mouse and keyboard will make our work slower. Therefore, replacing the mouse with the keyboard will make our work much faster, you will find that many of our operations can be completed with a keyboard, and the mouse will often feel very bad, generally choose not to use.

Learn with Xin Xing, spread programming knowledge, and revitalize the Chinese software. As Vim becomes increasingly familiar, you will get used to this pop-up keyboard typing sound instead of using the mouse.

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.