some examples: Searching: / search ? search backward # search current word n repeat search in same direction N Repeat search in opposite direction /[Return] repeat search forward ?[Return] repeat search backward
Replacing: cw replace a word c2w replace 2 words c2b replace 2 words backward c0 replace to the beginning of line c$ replace to the end of line cc replace entire line r replace 1 character ~ chaning case: upper -> lower, lower -> upper :%s/string1/string2/g Replace string1 with string2 in the whole document
发布评论
评论(5)
some examples:
Searching:
/ search
? search backward
# search current word
n repeat search in same direction
N Repeat search in opposite direction
/[Return] repeat search forward
?[Return] repeat search backward
Replacing:
cw replace a word
c2w replace 2 words
c2b replace 2 words backward
c0 replace to the beginning of line
c$ replace to the end of line
cc replace entire line
r replace 1 character
~ chaning case: upper -> lower, lower -> upper
:%s/string1/string2/g Replace string1 with string2 in the whole document
楼主真幽默
%s/this/that/g
有呀,看manual...
http://edt1023.sayya.org/vim/node6.html
==