vim replace all instances of selected text code example Example: vim replace in selection :'<,'>s/foo/bar/g