Vim Command Collation

Source: Internet
Author: User


1. Move the cursor
 
   
  
  1. hjkl
2. Delete characters
 
   
  
  1. x
3. Inserting characters
 
   
  
  1. i

4. Delete a word
 
   
  
  1. de
Do not include spaces
 
   
  
  1. dw
5 Remove from cursor to end
 
   
  
  1. d$
6 Deleting an entire row
 
   
  
  1. dd
adding a value before can delete more than one example 2DD delete two lines 2de Delete two wordsUndo Command
 
   
  
  1. u
Undo an entire row
 
   
  
  1. U
Restore Undo
 
   
  
  1. CRTL+R
Paste
 
   
  
  1. P
Replace word into Insert State
 
   
  
  1. cw
The instructions used in C and D are similar in that all are digital +c+ (e W $ D) equivalent to d+a combinationtransfer to the beginning and end of the file
 
   
  
  1. shift+g
  2. shift+G
Display text information
 
   
  
  1. CTRL+g
Looking for a fixed character/forward lookup? Reverse lookup n Then the previous forward lookup shift+n then the previous reverse lookup
 
   
  
  1. /
  2. n
  3. Shift+n
% = pair% pair Bracket
 
   
  
  1. %
Methods for correcting errors
 
   
  
  1. s/old/new/g
Replace a character in a line
 
   
  
  1. :s/old/new/g
Replace the first matching character of a row
 
   
  
  1. s/new/old<enter>
Replace all characters between the two lines
 
   
  
  1. :#,#s/old/new/g
Replace all characters between documents
 
   
  
  1. :%s/old/new/g
Ask the user when the full text is replaced
 
   
  
  1. :%s/old/new/gc
Execute external commands within VIM
 
   
  
  1. :!ls
Save the file as a file with the specified file name
 
   
  
  1. :w FILENAME
Save the contents of the specified section
 
   
  
  1. :#,# w TEST
Insert the contents of the specified file
 
   
  
  1. r FILENAME
Opens a new row and enters input mode
 
   
  
  1. o or O
Jump to the end
 
   
  
  1. $
Jumps to the end and enters input mode
 
   
  
  1. A
Replace
 
   
  
  1. R
Find ignores case
 
   
  
  1. :set ic
Find highlighting
 
   
  
  1. hlsearch
Find matches first display location
 
   
  
  1. incsearch


Vim Command Collation

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.