我,VIM, tutor, summary

我,VIM, tutor, summary

commands for VIM

h-left  j-down  k-up  l-right
vim FILENAME
:q!         %exit and trash all changes
:wq         %save all changes
i           %insert
A           %append
dw          del to the next word
d$          del to the end of a line
dd          del the whole line
2w          repeat a motion
operator    [number] motion
0           move to the start of the line
u           undo previous actions
U           undo all the changes on a line
CTRL-R      undo the undo's
p           put the deleted text after the cursor
r           replace the character under the cursor
ce          change to the end of the word
c$          change to the end of the line
c [number] motion
CTRL-G      display of location and file status
G           move to the end of the file
number-G    move to the line number of the file
gg          move to the first line
/name       search the target with forward direction    tpy n to the next, N the opposite direction
?name       search the target with backward direction   tpy n to the next, N the opposite direction
CTRL-0      back to older position
CTRL-I      to the newer position
%           match the () or [] or {}
s/old/new   substitute
s/old/new/g substitute works in all line
#,#s/new/old/g    substitue between two #
%s/old/new/g  substitute for all in the file
%s/old/new/gc  substitute with confirmation

25 Jun 2018

我,VIM, tutor, summary

学习一个,im angry!


:!ls                    show dictory listing
:del! FILENAME          remove the file
:w FILENAME             writes the current VIM file to the FILENAME
v-motion :w FILENAME    saves the selected line to the file
:r FILENAME             retrieves disk file FILENAME and puts it below the current pos
:r !dir                 
                                

25 Jun 2018

上篇我,VIM, tutor, summary2
下篇我,python, 优化2, Div684_C