Cursor: h left
j down
the shift k
l right
^ move the cursor to the beginning of the line
$ move the cursor to the end of the line
deleted: x delete a character
dw beginning of a word to delete from the cursor position, including spaces
de delete from the cursor position start of a word, no spaces
d $ delete all characters from the cursor to the end of the line
dd delete the line of the cursor
#dd # delete rows starting from the cursor position (# of digital)
undo: undo the last operation u
Ctrl + undo recovery r
cut: p remove the last of the cursor after the paste contents
Alternatively r move the cursor to the character to be replaced, the input r, then the input characters to be replaced, the replacement is completed (alternatively only a single character)
R Move the cursor to the character to be replaced, the input R, at this time becomes a replacement mode, all the input characters will be replaced, and exit directly press the ESC key
changes: cw move the cursor to the character to be replaced, input cw, position the cursor on a word beginning deleted, this time into the input mode, you can enter any content, press ESC to enter the complete exit
c $ move the cursor to the character to be replaced, type c $, the cursor end of line position to delete all, this time into the input mode, can enter any content, press the input completed ESC exit
: s / OLD_WORD / NEW_WORD
replaced OLD_WORD is NEW_WORD, replace the line cursor among the first to be matched here only OLD_WORD to words
: s / OLD_WORD / NEW_WORD / g
replaced OLD_WORD is NEW_WORD, where only the replacement cursor line which are all matched to word OLD_WORD
: # s / OLD_WORD / NEW_WORD / g
replaced OLD_WORD is NEW_WORD, where only the replacement cursor # row lines are all of them started to OLD_WORD matched word (digital #)
:% S / OLD_WORD / NEW_WORD / G
replacement OLD_WORD is NEW_WORD, replaced here Section of the document was OLD_WORD to match words
:% s / OLD_WORD / NEW_WORD / gc
Replace OLD_WORD as NEW_WORD, replace all matching documents to be OLD_WORD word here, and each word to be replaced prompt
positioning: Ctrl + g displays the file name at the bottom of the screen , line / line of all currently located, columns and other information currently resides
G to jump to the last line
#G Jump to # row (# digital)
Search: / forward search
reverse lookup?
the n-Find next
N Find a
% find the corresponding brackets, such as () [] {}
execute external commands:
:! the cOMMAND
input is complete, press enter to execute the command associated outside vim, then press enter to complete the execution, return vim in
Save as:: w FILENAME
save the file as the current file FILENAME
: #, # w FILENAME
the current file to the content of the first line # # row FILENAME saved as files (digital #)
Document insertion:: r FILENAME
contents FILENAME file is fully inserted into the current file, the inserted position of the current cursor position
input mode: i inserted at the cursor location
a is inserted after the cursor position
o in the line where the cursor insert line
I in the first row is inserted into the cursor line
a inserted end of the line the cursor line
O in the cursor line on the inserted line
Linux foundation --vim
Guess you like
Origin www.cnblogs.com/super2279/p/11583851.html
Recommended
Ranking