5、currentliney$CopytoendoflineDCuttoendofline搜索/wordSearch word fromtoptobottom?wordSearch word frombottomtotop*Searchthewordundercursor/cstringSearch STRING or string,caseinsensitive/jo[ha]nSearch john or joan/Search the or breathe/S
6、earch the/<¦.>Searchallwordsof4letters//Search fred butnot alfred or frederick/fred
7、joeSearch fred or joe/Searchexactly4digits/^{3}Find3emptylines:bufdo/searchstr/Searchinallopenfilesbufdo%s/something/somethingelse/gSearch something inalltheopenbuffersandr
8、eplaceitwithsomethingelse替换:%s/old/new/gReplacealloccurencesof old by new infile:%s/onward/forward/giReplaceonwardbyforward,caseunsensitive:%s/old/new/gcReplacealloccurenceswithconfirmation:2,35s/old/new/gReplacealloccurencesbetweenlines2and35:5,$s/old/new/gReplacealloccuren
9、cesfromline5toEOF:%s/^/hello/gReplacethebeginingofeachlineby hello:%s/$/Harry/gReplacetheendofeachlineby Harry:%s/onward/forward/giReplace onward by forward,caseunsensitive:%s/*$//gDeleteallwhitespaces:g/string/dDeletealllinescontaining string:v/string/dDeletealllinescontain
10、ingwhichdidn’tcontain string:s/Bill/Steve/Replacethefirstoccurenceof Bill b