当前位置:Linux教程 - Linux文化 - VI里面有没有查找,替换的功能,怎么实现

VI里面有没有查找,替换的功能,怎么实现


>>> 此贴的回复 >> 研究一下吧: http://edt1023.sayya.org/vim/node6.html

>>> 此贴的回复 >> 有呀,看manual...

>>> 此贴的回复 >> %s/this/that/g

>>> 此贴的回复 >> 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