Common vi editing commands and vi editing

Source: Internet
Author: User

Common vi editing commands and vi editing

It's really hard to remember so much in your blog. It's okay to repeat it from time to time.

From: http://www.cnblogs.com/junw_china/articles/1708967.html

Cursor control

Content editing

A: Append content to the end of the current row

I: insert content before the cursor

I: insert content after the cursor

O: add content under the row where the mouse is located

O: add content to the row where the cursor is located

ESC: exit the editing mode.

Ctrl-T: Move to the next tab

Backspace: move one character backward

Ctrl-U: Delete the current

Cw: Delete the character of the cursor and enter the editing mode.

Cc: Delete the row where the cursor is located and enter the editing mode.

C: Delete the characters from the cursor position to the end of the row and enter the editing mode.

Dd: Delete the current row.

NDd: Delete row n

D: Delete the characters after the cursor position of the current row.

Dw: Delete the character of the zip code

D}: Delete the remaining characters in the current segment

D ^: Delete the characters from the beginning of the row before the cursor.

C/Pat: Delete the content between the cursor and the first matching character

Dn: Delete the content between the cursor and the next matching character

DfA: Delete the content from the cursor of the current row to the matched characters (matched characters will also be deleted)

DtA: Delete the content between the cursor of the current row and matching characters (matched characters are not deleted)

DL: Delete content from the cursor to the last line of the screen

DG: Delete the content from the cursor to the end of the file.
J: link the content of the upper and lower lines

P: insert buffer content behind the cursor

P: insert buffer content before the cursor

RX: Replace characters with x

RText: Replace the cursor with text

U: undo the last change

U: restores the content of the current row.

X: remove the characters from the cursor's position.

X: remove the character before the cursor.

NX: Delete the first n characters. The characters in the cursor will not be deleted.

.: Restore the last change

~ : Reverse the case of letters

Y: copy the current row to the new buffer.

Yy: copy the current row

"XYy: copy the buffer named x of the current row.

Ye: copy it to the end of a word.

File Operations

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.