vim (y/n/a/q/l/^e/^y) code example Example 1: search and replace vim :%s/foo/bar/g Example 2: vim replace between lines :5,12s/foo/bar/g