Vim often uses command summary

Source: Internet
Author: User
Tags uppercase letter

VIM Command Summary

1. Delete characters
To delete a character, simply move the cursor over the character and press "X".



2. Delete a row
Delete a whole line of content using the "dd" command.

After deletion, the following lines are moved up to fill the vacancy.



3. Remove line breaks
In vim you can merge two lines into one line, meaning that the line breaks between the two lines are deleted: The command is "J".



4. Revocation
Suppose you mistakenly delete too much content.

Obviously you can enter it again. But the command "U" is more convenient. It is able to undo the last operation.

5. Redo
Suppose you undo it many times. You can also use ctrl-r (Redo ) to reverse the undo action.

In other words, it is an undo to undo. The Undo command also has a form,the "U" command, which undoes all operations on one line at a time. The second time you use this command, the previous "U" action is undone. with "U" and ctrl-r you can retrieve whatever state of operation.

6. Append (this time back into the edit state, ESC exits the edit state back to the command State)
The "I" command is able to insert text before the current cursor.
The "a" command is able to insert text after the current cursor.
The "o" command is able to start another line below the current line and turn the current mode into insert mode.
The "o" command (note that the uppercase letter O) will be a row above the current line.
(It's enough to develop more than a few iOS!)

< Span lang= "en-US" > 7. Using command count
   If you want to move up 9 line. This can be done with "a!!!". Another way is to use 3 indicates that the command will be run repeatedly 3 times. Same. Delete 3 characters can be

8. Exit
   to exit vim, with command "ZZ".

This command saves the current file and exits Vim.



9. Discard edits
Discard all changes and exit. With the command ": q!".

With ": e!" The command discards all changes and loads the original contents of the file again.

10. Move in Word
Use the "w" command to move the cursor forward one word to the first character. For example , "3w" moves the cursor forward by 3 words. The "B" command moves the cursor back to the first character of the previous word.
The "E" command moves the cursor to the last character of the next word. Command "GE". It moves the cursor over the last character of the previous word. 、

11. Move to the beginning or end of the line
&nbs

Vim often uses command summary

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.