Vim Common techniques

Source: Internet
Author: User
Tags save file

Edit

I  Enter the insert mode, the new character is inserted before the cursor a  into the edit mode, the new character inserted after the cursor C  modified d  Delete p  placed, you can delete the contents of D, placed behind the cursor y  copy r  Replace, Unlike C, where you do not have to go into edit mode to replace S  substitution, and C is different, you can only modify one character instead of the whole word X  and D is different, you can delete only one character instead of the whole word ~   Replace the case.  Repeat last command u  undo Previous Command J  merge two lines into one line

Save exit

Q  Exit, if there are unsaved changes can not exit Q!   Force exit W   Save file W!   Force Save ZZ  Save file and Exit E!  Roll back all modifications to the original state

Cursor

H move the cursor J down move the cursor k down move the cursor L move to the beginning  by moving the cursor 0 to the start of the line to the   end W  Move the cursor backward by word (including punctuation) W move the cursor backwards (ignoring punctuation) by word b move the cursor  forward (including punctuation) b by Word move  the cursor forward (ignoring punctuation) e moves  to the tail (including punctuation  ) e moves to the end of the word ( Ignore punctuation) G  move to the last line at the end of the file

Combo command

3h Move the  cursor 3 times to the left, the equivalent of lll3w to  move the cursor backwards by 3 words (ignoring punctuation, etc.) 1G  move to the first line of the file 3G  move to file the third line of CW  modified one word c3b  Modify the preceding three characters C $  modify the entire line of text after the cursor C0  Modify the cursor before the entire line of text DW  Delete word d3w  Delete three words 3p  repeated placement 3 times

Cursor Movement positioning

CTRL +F with PageDown key, move the whole screen down CTRL+B with PageUp key, move the whole screen up ctrl+D Move the half screen ctrl down+U Move up half-screen z[enter] make the current line that the cursor is pointing to becomes the first line Z of the screen. Makes the current line pointing to the cursor the middle row of the screen Z-Moves the cursor to the front of the screen to the end of the line h causes the cursor to move to the top row of the current screen m so that the cursor moves to the middle row of the current screen L make the cursor move to the end line of the current screen [Enter] to move the cursor to the first of the next line Character+with [Enter], so the cursor moves to the first character of the next line-moves the cursor to the first character of the previous line----------Combine command 3H to move the cursor to the next number in the first row of the current screen third line3Lmoves the cursor to the third row of the last line in the current screen----------move to Word by letter E/the tail of the word (including punctuation) E moves to the word/the tail of the word (ignores punctuation) (moves to the beginning of the sentence (according to?.!and other punctuation)) Move to the next sentence {move to the beginning of the paragraph (based on a blank line)} move to the next paragraph [[move to Chapter]] move to the next chapter3) ) to move to the back three sentences----------Mobile Search by search term should be the most commonly used move, in command-line mode, enter '/' to start the search/duweixin[Enter]: Search duweixin in the text/dianduo[Carriage Return]: In the text Dianduo when you want to continue searching, enter N VI will jump to the next matching search where n VI will jump to the last matching search place/search backwards from cursor position? Search forward from cursor position

Vim Common techniques

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.