Vim usage Summary

Source: Internet
Author: User

Vim has been used for a while, but it is still at the cainiao level. Write down frequently used shortcut key commands:

CTR + Z: equivalent to ESC

CTR + P: Code Completion DD: Cut P: paste Y: Copy Za: fold format code: Gg = g remarks:
Gg -- arrive at the beginning of the file
= -- Requires indentation
G -- until the end of the file
Jump to function and variable definition: 
[+ Ctrl + I: Jump to function, variable, and # define [+ Ctrl + D: Jump to # define Ctrl + I: jump forward to the previous few cursor positions
CTRL + O: jump back to the last few cursor positions

Function body jump:

[[
]
[]
] [
{}

In normal mode, the cursor stops on a character. Ga can view the ASCII code of the character.
# Copy, delete, and paste operations: Press V (SHIFT + V) to enter the visual mode, select the desired row from the upper and lower of JK, and then press

Y Replication
D. Delete
X cut
P Paste
Jump to a line: ,+ Row number encoding: set encoding = UTF-8 # Fix garbled characters
Set fileencodings = ucs-bom, UTF-8, cp936, gb18030, big5, EUC-JP, EUC-KR, Latin1

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.