Vi cursor movement command, vi cursor command

Source: Internet
Author: User

Vi cursor movement command, vi cursor command

I. Overview

In vi, the basic cursor movement commands include h, j, k, and l.

H indicates that the cursor moves 1 bit left, j indicates that the cursor moves 1 row down, k indicates that the cursor moves 1 row up, and l indicates that the cursor moves 1 bit right.

The preceding command supports the "Number + command" format, which allows you to move Multiple Digits (rows) once ).

Ii. Example

Initial status

01234

0123

012

Run the command: l

01234

0123

012

Run the command: 3l

01234

0123

012

Run Command: j (Note: The number of digits in 1st rows is more than 2nd. Run the j command and move the cursor to the last digit in the next line)

01234

0123

012

Run the command: k (Note: if the number of 1st lines is more than 2nd, run the k Command and move the cursor to the position before the previous line of j command, 4 in this example)

01234

0123

012

Run the command: 2j

01234

0123

012

Run the command: h

01234

0123

012

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.