Vim column editing

Source: Internet
Author: User

1) insert function (that is, insert one or several characters in a column of several rows)
Step 1: move the cursor to the specified position of the row to be inserted.
Step 2: press Ctrl + V to enter the visual block mode.
Step 3: move the cursor to the specified position of the last inserted row (by J or input row number + G)
Step 4: Shift + I to enter the insert mode
Step 5: Enter the characters you want to enter. After that, press the "ESC" key twice to view the expected results.
2) Deletion
Same as step 1 ~ Step 3
Step 4: Press D.
Step 5: Same as step 5
3) Replace
Press R with the same name, and enter the characters to replace.
4) Modification Operation
Press C as the same as above, and then enter the characters to modify.

For other VI operations, refer to the following link:

Http://edyfox.codecarver.org/html/vim_edit_tips.html

1. Exchange two characters
XP
2. Change the upper and lower lines
DDP
3. Merge the upper and lower rows
J
4. Delete all rows
DG
5. delete from the current position to the end of the row
D $
6. copy from the current position to the end of the row
Y $ can be pasted to another place.

Move, copy, and delete multiple rows
: N1, N2 M N3 move the n1-n2 line (including N1, N2) to below the N3 line;

: N1, N2 Co N3 copy the n1-n2 line (including N1, N2) to below N3 line;

: N1, N2 D Delete n1-n2 rows (including N1, N2;

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.