Vim Common commands

Source: Internet
Author: User

  • .: The point command is the most important command, the function is to repeat the previous command
  • Numbers: Adding numbers to a command can improve efficiency, such as 100j moving down 100 rows, 100dd deleting 100 rows
  • Cursor Movement:
    • H: Left
    • J: Next
    • K: Up
    • L: Right
    • B: Previous word
    • W: Next word
    • Number 0: Move to the beginning of the current line
    • ^: Move to the first letter of the current line
    • $: Move to end of line
    • (: Previous sentence
    • ): Next sentence
    • *: To the next place where the string appears
    • #: equals the opposite direction *
    • H: To the top of the screen
    • M: To the middle of the screen
    • L: To the bottom of the screen
    • G: To the bottom of the file
    • GG: To the top of the file
    • <CTRL-F>: Move Down one screen
    • <ctrl-d>: Down half screen
    • <ctrl-b>: Up one screen
    • <ctrl-u>: Up half screen
    • F+{char}: Moves to the next character in the current line, you can use a semicolon to repeat the command, and the comma is to look back
    • T+{char}: Move to the previous character of the next character in the current line
    • F+{char}: equals the reverse F
    • T+{char}: equals the reverse T
    • /string Enter: Find string, return to the result can press N to move to the next result, n move to the previous result
    • ? string: As opposed to/string
    • %: Move between pairs of parentheses
    • '.: Move to the last edited place
  • Insert:
    • I: Insert on the left of the current character
    • I: Inserting at the beginning of the current line
    • A: Insert to the right of the current character
    • A: Insert at the end of the current line
    • o: Insert a new row below the current line
    • O: Insert a new row above the current line
  • Cut Copy:
    • P: Paste
    • X: Delete the current character
    • S: Enter x in insert mode
    • D: Cut the content from the cursor to the end of the line
    • D: Cut the contents of the current selection
    • DD: Delete When moving forward
    • DW: Delete the remainder of the word after the cursor
    • d$: Delete the remaining portion of the line after the cursor
    • C: Cut the content from the cursor to the end of the line into insert mode
    • C: Function and D are the same, the difference is that after the operation into the insertion mode
    • CC: function and DD Same, also enter insert mode
    • Y: Copy the contents of the current selection
    • Y: Copy When moving forward
  • Bookmark:
    • M{A-Z}: Marks a bookmark at the current cursor, only a single lowercase letter
    • ' A: To bookmark a

Vim Common commands

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.