Summarize a few very useful but often don't remember the use of VIM command.

Source: Internet
Author: User

Moving from my blog: http://www.xgezhang.com/vim_command_useful.html

Vim this thing is to use more practice, a period of time after the summary. Here is a list of some of the most useful and less skilled commands to use as a record review.

o Insert a line after the current line, accustomed to end+i+enter, this is simply too much convenience.

I Insert at the beginning of the current line.

A is inserted at the end of the current line.

After the lookup, press N to reverse the lookup.

DDP is the dd+p effect for exchanging the current line and the following line, but it takes two times to undo because it is a two-step operation.

Number + hlkj or up and down: moving numbers so many characters, individuals or not too accustomed to hlkj, up and down arrows will use it.

W,b: Move forward (rear) a word, the same can add a number such as 2b, to the end of the line will be automatically wrapped.

GG: Move to the file header, this can be used: 1+enter instead.

G: Move to the end of the file.

X: Delete the current character, practical, unless you just delete it instead of adding new content, it's not as good as backspace after insert.

J (SHIFT+J): Deletes a blank line between two rows, the effect is equivalent to merging two rows.

Xp:x+p, the effect is to exchange the current character and a subsequent character, the use of the words may be written in parentheses of the program and the number of the inside of the case, such as the reverse of the situation, general-like.

         two ways to hang vim back to the shell: Ctrl + Z- > Command Line input FG return   

: SH---ctrl+d accustomed to this method

Insert mode: Ctrl+p the words that appear in the auto-complement text, long-function long-variable gospel.

Ctrl+y: Enter after a row, and then press and hold Ctrl+y to copy the previous line of characters from scratch, and use this function if you want to copy the previous part of the previous line.

For the time being.

Welcome reprint, please indicate the source

Summarize a few very useful but often don't remember the use of VIM command.

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.