Vi & amp; vim move the cursor to scroll the screen

Source: Internet
Author: User

Abstract:

1) move the cursor in the screen;

2) move the cursor inside the row;

3) screen scrolling;

Vi & vim has the compilation mode and command mode. The following cursor movement operations are performed in command mode;

The following uses the ^ character to indicate that the Ctrl key is pressed. For example, ^ F indicates that the Ctrl and F keys are simultaneously pressed;

In the following, press a key with the + sign and then press another key. For example, z + Enter indicates that the z key is pressed first, and then the Enter key is pressed;

1. move the cursor on the screen:

In vi & vim command line mode, the cursor position is moved to the front of the word and letter to be edited.

Button operation description

H move the cursor one character to the left;

J. move the cursor down a row;

K move the cursor up a row;

L move the cursor one character to the right;

Numeric value + G cursor move to the beginning of the row referred to by "numeric;

^ H move the cursor to the beginning of the first line on the current screen;

^ M move the cursor to the beginning of the row in the middle of the current screen;

^ L move the cursor to the beginning of the last line displayed on the current screen;

2. move the cursor in the file row:

In vi & vim command line mode, the cursor is moved inside the line. Words are separated by spaces. punctuation marks are considered as a word.

Button operation description

0 (number zero) move the cursor to the beginning of the row where the cursor is located;

$ Move the cursor to the end of the row where the cursor is located;

W move the cursor to the beginning of the next word;

B. move the cursor to the beginning of the previous word;

E move the cursor to the end of the word where the current cursor is located;

3. Screen scrolling:

Button operation description

^ F the screen is scrolled down;

^ B: the screen is scrolled up;

^ E scroll down a line;

^ Y the screen scrolls one line up;

^ D. Scroll down the half screen;

^ U screens scroll up half screen;

Z + Enter scroll the screen to make the row where the current cursor is located in the first line of the screen;

Z +. Scroll the screen so that the row of the current cursor is in the middle of the screen;

Z +-scroll the screen to make the row where the current cursor is located in the last line of the screen;

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.