vim search and replace in selection code example
Example 1: search and replace vim
:%s/foo/bar/g
Example 2: vim search and replace between lines
:<start_number>,<end_number>s/search_text/replacement_text/g
1. I mispeled a word on this line
2. I also mispeled a word on this line
3. Apparently I cant type mispeled properly
:2,3s/mispeled/misspelled/g
Example 3: vim replace in selection
:'<,'>s/foo/bar/g
Example 4: search and replace vim
:6,10s/<search_string>/<replace_string>/g | 14,18&&
Example 5: vim replace between lines
:5,12s/foo/bar/g