Sinsing with you. Vim for the second verse move cursor with vim command

Source: Internet
Author: User

first of all, it is worth mentioning that my Vim tutorial PDF version has been finished, you can download, here is csdn: csdn download , if the left side of the hanging off, you can also enter below the browser to download the following address: http://download.csdn.net/detail/xinguimeng/7714213, of course, if you are a loyal user of Baidu network disk, Can also rely on Baidu network disk, I also synchronized to Baidu Network disk, as follows: Baidu network disk download , if the address is hung, you can enter in the browser: http://pan.baidu.com/s/1sj9CLXz to download.

Four arrow keys to move the cursor *************************

1. In the long use of win, will find the mobile cursor with the mouse, even if there are four keys are rarely used, but in the vim advocated using the keyboard instead of the mouse idea, VIM has more complex to use the mouse to replace the keyboard to move the cursor of a series of commands.

2. In the command mode, if we are in insert mode, we can click ESC to command mode, and then use HJKL to move the cursor, the four keys are connected, where h means to move the cursor to the left one unit, J for moving down a line, k means the cursor moves up a row, l means the cursor moves to the right line.

3. This command is a bit of a mouthful, but the memory is not difficult, H and L respectively in four keys on the leftmost and rightmost, the meaning is also left to move and move to the right, and JK is connected, because J in front, converted to vertical direction is below, and K in the back, corresponding to the vertical direction of the top.

4. In fact, these commands are used more than the natural nature of the hand will be so knocked out, after still rely on the touch.

Other commands to move the cursor **************************

1. First say w means to move backwards to the first letter of the next word, W is the first letter of Word, and B moves forward a word, and its cursor automatically moves to the first letter of the previous word, where B is the first letter of "before".

2. Then e means moving backwards to the last letter of the next word, and the GE command means moving to the last letter of the previous word.

3. For what is a "word", this one in vim is freely defined, by default the punctuation will also be considered a word, of course, this one we can modify it, and so on when we study the configuration item.

4. If the reader is familiar with regular expressions, then a few commands are well understood. The ^ command automatically moves the cursor to the beginning of the current line, and the $ command automatically moves the cursor to the end of the current line, as well as a 0 command, which indicates that the cursor is moved to the first character of the current line.

5. Many commands can accept a number used for counting, that is, the value count. For example, 2$ moves to the end of the next line rather than the end of the current line, but the 0 command and the ^ command cannot be counted as a numeric value because there is no practical meaning.

f command and T command *****************************

1. Let's talk about the F command and the T command, both of which are search commands that cannot be used alone, and must be combined with other characters to represent the character behind the search.

2. For example, we use the FX command, then we will find the position of the first X character after the character, and position the cursor to the character up, we can also use the FX command, it is left to search, where F is "find" means "find, find".

3 For example, if we use the TM command, we will find the position of the first m after the character, but the cursor does not stay on M, but instead stays on the left side of M, where the lowercase t means search to the right and the uppercase T for the left.

Actual combat part *******************************

1. As I am in the online blog to write tutorials, very inconvenient, recommend everyone to download my PDF version of the tutorial, there are a lot of.

2. Let's first enter a text on this vim and then use ESC to go back to command mode and see the following:

.

3. Let's enter the 4w command in command mode, but let's not worry, let's see what Input 4 will show. See below:


4. Then we enter W, that is when our 4w command is finished, let's look at the effect:


5. If I give you a little bit of operation, will certainly be tired of smoking, you can download my PDF version of reading, inside a lot of.



Answer reader Questions *****************************

1. Some people may ask: Sinsing, what is the use of these commands for moving cursors?

2. I can only say: There is no use at the moment, but with the next few of our commands, it can quickly implement the features such as copy and paste, so that we move the mouse to copy and paste faster than an order of magnitude.

3.vim Broad and profound, the future of learning road, and gentlemen mutual encouragement.


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.