Vim Common shortcut key series

Source: Internet
Author: User
Tags lowercase

1. Direction key
H: equivalent to left button
L: Equivalent to right-click
K: equivalent to the upper key
J: equivalent to the next key
###############################################################
2. Move the cursor
Move the cursor to the first line of the file GG
Move the cursor to the last line of the file G
Move the cursor to the nth row of the file Ngg
Move the cursor to the beginning of this line 0 (number 0)
Move the cursor to the end of the line in this line $
###############################################################
3. Editing (mobile editing)
Insert a row below the current line and enter edit mode o (lowercase letter O)
Insert a row above the current line and enter edit mode O (capital letter O)
Delete the contents of the cursor at the end of the line and enter edit mode C (capital letter C)
Delete the position of the cursor at the end of the line D (Capital letter D)
Quickly reach the end of the line and enter edit mode a (capital letter a)
###############################################################
4. Copy Delete Paste
Copy yy
Copy cursor location down multiple lines Nyy
Paste P
Paste NP multiple times
Delete/Cut DD
Delete the contents of the current line to the end of the file DG
###############################################################
5. Batch Operation
1) Bulk Delete
CTRL + V enters visualization mode
Press the up and down keys to select the area you want to delete
Delete D
2) Batch Increase
CTRL + V enters visualization mode
Press the up and down keys to select the area to add content to
Press SHIFT + I (lowercase letter i)
Edit the content you want to add
Press and hold the ESC key to exit
################################################################
6. Other
Show line number set Nu
Suppress line number set Nonu
Find
/+ What you're looking for n (lowercase letter) Continue search down N (capital letter N) continue to search up
Undo Current Operation U (lowercase letter u)
Restore the Operation Ctrl+r
################################################################
7. Common faults
When the Vim editor suddenly loses power or interrupts, and then edits the file, it prompts for temporary file existence.

Exit by Capital Letter Q
Then Vim-r soft.txt continue to edit save exit Wq can
Finally, delete the temporary file. SOFT.TXT.SWP (picture red box Callout)
Delete temporary files rm-f. soft.txt.swp
You can recover the data.

Vim Common shortcut key series

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.