You'll never BELIEVE what Bruce Easton said here...: > (for vi I think the ed command to switch them > would be: :g/html \"1\" ^A/s/html \"1\" ^A/jsfile \"1\" ^A/g) I believe you mean :s not :g ...and if you're not on the line in question, then :%s mark->