Summary of common VIM commands

Source: Internet
Author: User
Merge the two lines into one line in VIM: "J undo all Operation Commands on one line:" U "starts another line under the current line and enters the insert mode: "o" starts another line above the current line and enters the insert mode: "O" jumps to the next line command: "k" deletes the character at the current cursor position command: "x", meaning to the "dl" command

Merge the two lines into one line in VIM: "J"

Undo all Operation Commands for a row: "U"

Start another row under the current row and enter the insert mode: "o"

Start another row above the current row and enter the insert mode: "O"

Go to the next line and run "k"

Command to delete the character at the position of the current cursor: "x", which is the same as the command "dl"

The command used to delete the first character of the current character is "X", which means the same as the command "dh ".

The command to delete from the current cursor position to the end of the line: "D", which is the same as the command "d $ ".

The command from the current cursor position to the end of the line: "C", which is the same as the command "c $"

The command that copies the content from the current cursor position to the end of the line: "Y", which is the same as the command "y $ ".

Place the cursor at the end of the row of the current row and insert the cursor in the "A" mode"

Place the cursor before the first non-blank character in the line and enter the insert mode: "I"

After modifying the document, you want to discard all modifications and re-edit the file (re-load the file): ": e !"

After modifying the document, save the document and exit the VIM editor command: "ZZ"

Command to place the row where the cursor is located in the center of the screen: "zz"

Command to place the row where the cursor is located at the top of the screen: "zt"

Command to place the row where the cursor is located at the bottom of the screen: "zb"

To view help information about a special topic, run the following command: ": help topic"

The command for moving a word forward and positioning the cursor at the word header: "w"

Move a word backward and position it at the beginning of the word: "B"

The command that moves a word backward and positions it at the end of the word: "e"

The command to move a word forward and position it at the end of the word: "ge"

Run the "^" command to move the cursor to the first non-blank character in the current line"

The command to move the cursor to the beginning of the line: "0". Note that this character is "0"

Run the "$" command to move the cursor to the end of the current line"

Search for the first occurrence position of a letter in a row from the current cursor position to the end: "f + letter", for example, search for the letter "x" as "fx"

The command to search for the first occurrence of a letter from the current cursor in the direction of the head: "F + letter"

In a row, search for the first occurrence position of a letter from the current cursor position to the end, and place the cursor in the first position of the letter: "t + letter"

In a row, search for the first occurrence position of a letter from the current cursor position to the header, and place the cursor in the next position of the letter: "T + letter"

Repeat the command for the last command: ";"

Jump to the second half of the matching brackets of the current cursor position, or the current cursor position is not a bracket, find a bracket at the end: "%"

The command to calibrate the light in a line: "Count + G". if the counting value is default, it will jump to the last line.

Jump back to the jump position of the previous jump command:''

The command to jump to the first line: "gg"

Move the cursor by the percentage of the move position to the full text: "Count + %". the count here indicates the percentage of the move cursor.

Move the cursor to the top line of the current screen text: "H"

Move the cursor to the middle line of the current screen text: "M"

Move the cursor to the last line of the current screen text: "L"

Use the word in the cursor position as the search target string to search for the text tail: "*"

Use the word in the cursor position as the search target string to search for the text header: "#"

Delete the entire line: "dd"

The command to change the entire line and keep the line indented: "cc", which is the same as the command "S ".

The command for modifying a character: "cl", which has the same meaning as the command "s"

Replace the character at the current cursor position and return to the command mode command: "r + replace character"

Repeat the previous command for modifying the text action: "."

To enter the visual mode ("visual" mode, you can select the text, but only select a single character), the command is: "v"

The command to enter the visual mode ("visual" mode, you can select the text, but you can only select the unit of behavior) is: "V"

Copy the command of the specified text: "y"

Command for copying a line of text: "yy"

Paste the data in the VIM cache to the command after the current cursor character: "p"

Paste the data in the VIM cache to the command before the current cursor character: "P"

Command to change the case sensitivity of the letter where the current cursor is located: "~" (This command sets the 'tildeop' option)

The following is a command combination:

At any position of a word, "daw" will delete the entire word. "daw" = "delete a word"

At any position of a sentence, using "cis" will delete the current sentence for modification, but will not delete the blank characters after the current sentence, "cis" = "changeinner sentence"

At any position of a sentence, the use of "das" will delete the current sentence, but will delete the blank characters after the current sentence, "das" = "delete asentence"

Simple tail search command: "/+ String + carriage return"

A simple search command for the header: "? + String + press enter"

When a word is searched, only the command at the end of the word is matched: "/+ String + '\>' + press enter"

When a word is searched, only the command at the beginning of the word is matched: "/+ '\ <' + String + carriage return"

When you search for a word, run the "/+ '\ <' + String + '\>' + press enter" command to match the entire word"

When searching for a word, only the command that matches the word starting with a line: "/+ '^' + String + carriage return"

When searching for a word, the command matches only the word at the end of a row: "/+ String + '$' + press enter"

When searching for a word, only one line of the command with only one word is matched: "/+ '^' + String + '$' + press enter"

Wildcard character used to search for a word: "." any character

Remove the special meanings of special characters in a search term: "\ + special meanings, such as" \."

Command for making tags in the text: "m + Letters", a total of 26 tags (26 letters)

Command to jump to the custom tag location: "'+ tag Letter" ("'" is the key located under the ESC key in the upper left corner of the keyboard)

The first line to jump to the custom tag location: "'+ tag letter"

Command: ": set number" \ ": set nonumber" for displaying the line number of text"

In the lower-right corner of the current screen, the command ": set rsequence" \ ": set northeasters" is used to display \ close the current cursor position"

Command to display the current mode: ": set showmode"

When searching strings, ignore/ignore case-insensitive commands: ": set ignorecase"/": set noignorecase"

Command for setting all search results to highlight/not to highlight: ": set hlsearch"/": set nohlsearch"

Only the non-highlighted command for the current search: ": nohlsearch"

When searching, enter the target character while searching: ": set incsearch"

When you set a search condition, run the ": setwrapscan"/": set nowrapscan" command to search for/without repeating the text (after the end of the file is searched, the file is no longer re-searched"

View the command for placing the vim configuration script: ": scriptnames"

Command for displaying the position of the current cursor: "Ctrl + G"

Undo the command for using the action "u": "Ctrl + R"

Command to scroll up a screen: "Ctrl + B"

Command to scroll down a screen: "Ctrl + F"

Command to scroll up the text half screen: "Ctrl + U"

Command to scroll down the text half screen: "Ctrl + D"

Run the following command to scroll down a line of screen text: "Ctrl + E"

Run the following command to scroll up a line of screen text: "Ctrl + Y"

Jump to the jump position of the second jump command: "Ctrl + O"

Opposite to the previous command: "Ctrl + I"

Visual mode, and the command for selecting objects in rectangular blocks: "Ctrl + V"

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.