vim select all and replace code example
Example 1: vim replace in selection
:'<,'>s/foo/bar/g
Example 2: linux vim replace all
%s/{the word you want to find}/{word to replaced with }/gc
:'<,'>s/foo/bar/g
%s/{the word you want to find}/{word to replaced with }/gc