Try the http://www.faqs.org/faqs/editor-faq/vi/part1/
As to the your substitution string of ".,$s/dog/cat/g", here's a brief explaination:
the ".,$" portion is the range of the search and replace. The character before the "," tells where to start the search and replace operation. The character...