You can also, do it this way as well while in the file.
vi filename
:g /oldword/s//newword/g
Only one space after the first "g" and no other spaces. This will replace every instance in the file.
If you leave off the last "/g" it will only replace the next instance of the word you want to change.