Vim Editor Operation ②

Source: Internet
Author: User

This article mainly introduces the common editing commands of vim:

Character editing:

    x: Delete the character at which the cursor is located;

    #x: Delete the # characters at the beginning of the cursor;

Replace command:

    R: Replaces the character at which the cursor is located;

Rchar;

For example: Replace the L in the list with the uppercase L, assuming the cursor is now in the list L, you need to press the R key, press "Shift+l" to complete the replacement;

Delete command: The deleted content does not disappear completely and is stored in the corresponding buffer area.

    D: Can be combined with the cursor jump character, to achieve range deletion;

Example: d$, d^, DW, DE, DB (also supported #command)

    DD: Delete the row where the cursor is located;

#dd: Delete the total # line at the beginning of the cursor (including the row on which it is located);

Copy command:

    y: The working behavior is similar to the D command;

Paste command:

    P: the content within the buffer (that is, the copied content) is pasted at the bottom of the line where the current cursor is located, if it is an entire line , otherwise, the back side of the current cursor;

    P: The content within the buffer (that is, the copied content) is pasted at the top of the line where the current cursor is located if it is an entire line , otherwise, the front side of the current cursor is pasted;

Change the command:

    C: Can be converted from edit mode to input mode, and implement the deletion function, similar to the D command;

Undo command:

    u: Undo the previous operation;

    ctrl+r: Revocation of previous revocation;

Repeat the previous edit operation:. No.

Visualization mode: Similar to the area Check feature in Windows text

Press the v key: Select by character;

Press the V key: Select by row;

Note: Can be used with cursor jump to achieve range selection;

Report:

Vim's multi-file feature:

Multiple files:

Vim FILE1 FILE2 ....

To switch between files:

    : Next Next file

    : Prev Previous file

    : Last File

    : First file

Exit All Files:

    : Wqall Save all files and exit

    : Wall

    : Qall

Multiple windows:

    - o: Horizontal split window

    - o: Vertical Split window

Switch between the Windows: First press the CTRL+W key and then release, then press the corresponding direction key;

Note: Individual files can also be viewed in separate screens

        ctrl+w s: horizontal split window;

        ctrl+w v: vertical split window;

Vim Editor Operation ②

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.