header

vi editor sting search and replace

/string        search forward for string (end with Enter)
     ?string        search backward for string (end with Enter)
     n              repeat the last search (``next search'')
          :s/s1/s2       replace (``substitute'') (the first) s1 in this line by s2
     :lr/s/s1/s2/g  replace all instances of s1 in the line range lr by s2                     (lr is of form `a,b', where a and b are either explicit

No comments: