Search/replace all foo by bar in the file
foo
bar
:%s/foo/bar/g
To reuse value match in the search: \0
ex: Add a word to all last line in a file:
:%s/.$/\0zzzz/g