vim search and replace range in all lines code example Example: vim replace between lines :5,12s/foo/bar/g