Vim shortcut key record (encountered at work)

Source: Internet
Author: User

A mobile class

1. Move to the first line of the file GG

2. Move to the last line of the file G

3. Move to the top line of the current screen H

4. Move to the last line of the current screen L

Two editing classes

1. Replacement character R

2. Delete character X

3. Undo edits (Restore modified content) u

4. Redo (Restore undone content) Ctrl + R

5. Undo U Undo an index change in one row (you cannot recover from a row after you have done it many times elsewhere, only the line that is currently being edited)

Three copy cut paste

1. Cut multi-row ndd N to the number of rows that need to be cut, DD to cut one row

2. Duplicate multiple lines 1 (suitable for a small amount of text)

Nyy means that the replication includes n rows from the current line

yy means copying when moving forward

P Paste, copy, move the cursor to the pasted position, press p to paste the copied content

NP Pastes the copied content at the cursor n copies

3. Duplicate multiple lines 2 (for large amounts of text)

In command-line mode (press ESC), enter ": 5," which means that the contents of the 12-26 rows are copied to the 5th row after the

4. Duplicate multiple lines 3 (for large amounts of text)

Label Copying method:

Move cursor to copy start line, enter MA

Move the cursor to the end of the copy line, enter MB

Move the cursor to the line you want to paste, enter MC

Last input: ' A, ' B Co ' c means to paste the contents of a to B (including A. a) line to the next line in line C

Convert Co to MV for cut and paste

Quad Find class

1. Forward Lookup/string

Reverse lookup? string

After entering the Find command, n means finding the next, n means finding the previous, CTRL + C ending Lookup

Five other classes

Vim shortcut key record (encountered at work)

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.