command mode - Normal and initial state; others return here (use ESC to abort a partially typed command)
input mode - entered by specific commands a i A I o O c C s S R and ended by ESC or abnormally with interrupt
line mode - i.e. waiting for input after a : , / , ? or a !
command (end with CR, abort with CTRL-c). CTRL is the control key: CTRL-c means "control c"
[ addr ] s/from/to/ [ g ] Search for the occurence of from
and replace it with to in the current line, or in the range
addr (two line numbers seperated by command; 1,$ is the whole file).
Replaces one occurrence per line, or all occurrences
if g is specified.
For example, :3,20s/someword/anotherword/g Will replace "someword" with "anotherword" starting from line 3 to line 20. 'g' is global means replace all occurrences of "someword".