General operation in "Vim" normal mode

Source: Internet
Author: User

Normal mode is usually used to browse the text, in fact, the keyboard command to let the cursor jump in the text, in any mode press or two times <Esc> will enter the normal mode.

Basic ideas

Vim's positioning of the cursor is very precise and efficient, which is a very useful place to use. However, because of the combination of keys and keys too much too complex, will make a lot of beginners deterred.

In fact, VIM cursor positioning is a regular, as if learning wubi typing, it seems to remember a lot of words root, in fact, the keyboard of the word root arrangement is very regular, once clear these laws, learning will have a lot of heart.

For VIM, many of its operations follow the pattern of < quantities >< actions >< units > such that the 3 can be combined with each other,< quantity > cannot exist alone. For example, W is the cursor to the right to move 1 words, while 3w is the cursor to the right to move 3 words; DW is the deletion of a word after the cursor, and 3DW is the deletion of 3 words after the cursor.

The < actions above > are mainly used in insert mode, the next article,< units > Small to large include characters, words, lines, sentences, paragraphs, screens, pages, and files.

Basic instructions

These < units > corresponding basic cursor positioning instructions are given below:

Unit Command Description
Character H Move left 1 characters
L Move right 1 characters
Words W, W Move to the beginning of the next word, with uppercase words separated by spaces
B, b Move to the beginning of the previous word
E, E Move to the end of the current word
Yes J Move Down 1 rows
K Move up 1 rows
0 Move to the beginning of the line
^ Move to first non-whitespace character at the beginning of the line
$ Move to end of line
<n>| Move to column N of the current row, for example 12| is moved to column 12th
<n>g Move to line N, for example 12G is moved to line 12th
+ Move to the next line at the first non-whitespace character
- Move to the first non-whitespace character on the previous line
Sentence ) Move to the end of a sentence
( Move to the beginning of a sentence
Paragraph } Move to end of paragraph
{ Move to the top of the paragraph
Screen H Move to the top row of the screen
M Move to the middle line of the screen
L Move to the bottom line of the screen
<ctrl>+e The screen scrolls down one line and the cursor does not move
<ctrl>+y The screen scrolls up one line and the cursor does not move
Zt Move the current line to the top of the screen
Zz Move the current line in the middle of the screen
Zb Move the current line to the bottom of the screen
Page <ctrl>+f Scroll down one page
<ctrl>+b Scroll up one page
<ctrl>+d Scroll down half page
<ctrl>+u Scroll up half page
File Gg Move file start
G Move end of File
<n>% Move to the file n%, for example, 30% is located at file 30%

Remaining Jump commands

TODO:%, [[]] [] [...]

Reference

    1. https://www.ibm.com/developerworks/cn/linux/l-cn-tip-vim/

General operation in "Vim" normal mode

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.