vim search and replace text

Different ways of replacing text etc.

Replace every occurrence of pattern1 (pat1) with pat2

:g/pat1/s//pat2/g

Replace every occurence of pattern1 (pat1) with a newline

:g/pat1/s//\r/g

In practice this inserts a newline after every occurence of pat1.