Linux applications: Vim quick operation

Source: Internet
Author: User

1. Delete characters

< normal mode >

X: Delete the character under the cursor

DD: Delete a whole line, including line breaks

J: Delete the line break of the current line and execute anywhere in the current line

2. Withdrawal and annoyance cancellation

< normal mode >

U: Undo the most recent operation, continuous execution will be continuously revoked

U: Row undo, undo all changes to the last row

Ctrl+r: Anti-revocation, anti-revocation of U (lowercase), (Invalid for U (uppercase))? Not even pressing? )

3. Enter edit mode

< normal mode >

I: Enter edit mode, start position bit cursor in front of the character

A: Enter edit mode with the start position behind the character of the cursor

O (lowercase): Enter edit mode and insert a new line below the line where the cursor is located

O (Uppercase): Enter edit mode and insert a new line above the line where the cursor is located

4. Exit Vim

< normal mode >

"ZZ": Save and exit

": Wq": Save and exit

": q!": Do not save, exit

5. View Help

< normal mode >

": Help": Open the helper document window and exit the Help document by exiting the normal document +

CTRL +] (brackets): Jump to Hyperlink (Help document in the form "| ... |" The place for hyperlinks)

Ctrl+t: Jump to the previous label location

Ctrl+o: Jumps to the previous edit place, may jump to other documents

": Help {option}": Displays the assistance document for the specified action

": Help Exx": Display the error code of the aid document, XX is the error code

6. Quick Move

< normal mode >

W: Move forward to the next character at the end of the word

E: Move forward to the end of the word

B: Move backwards to the beginning of the word

GE: Move backwards to the end of the previous word

$: Move to end of line

^: Move to the first non-empty character of the line

0 (number): Moves to the first character of the line

FX: Move forward to the bank's next character "X"

Fx: Move backwards to the first character "X" of the Bank

%: The current cursor is not in parentheses (various brackets), if there is a parenthesis character in the bank, move forward to the first parenthesis

The current cursor is on the parentheses, and it is moved to the parentheses that match that bracket (can span lines)

NG: Moves to the nth row of the file

GG: Move to line 1th of the file

H: Move to the first line of the current screen

M: Moves to the middle row of the current screen

L: Move to the last line of the current screen

Ctrl+u: Scroll down half screen (top half display)

Ctrl+d: Scroll up half screen (the lower half screen is shown)

7. Determine when to proceed

< normal mode >

Ctrl+g: Displays the current cursor location details

": Set Number": Displays line numbers (Short command: ": Set Nu")

": Set Nonumber": line number is not displayed (Short command: ": Set Nonu")

": Set ruler": real-time display of the cursor location information (lower right corner)

Linux applications: Vim quick 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.