Use of Vim

Source: Internet
Author: User

First, the common key description

1. General mode

Keys Description
0 Move to the front of the line
$ Move to the last face of the line
G Move to the last line
NG Move to Nth row
X Remove one character backwards
Dd Delete the row
Ndd Delete N rows
Yy Copy the row
Nyy Copy n rows
P Paste a line on the cursor
U Revoke
. Repeat previous action

2. Command-line mode

Keys Description
: W Save
: Q Leave
: Wq Leave after saving
Zz Equivalent to: Wq
: W[filename] Save in filename
: Set Nu Show line Numbers
: Set Nonu Cancel line number
/word Find word down
: 1, $s/word1/word2/g Replace the word1 with the Word2

Ii. Other Notes

VI is divided into 3 modes: General mode, edit mode, command line mode

You cannot switch between edit mode and command line mode.

In VI, the [TAB] key results are not the same as the results obtained by the space character.

Vim also has 3 important functions: Block selection, multi-file editing, multi-window function

Use of Vim

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.