- Write the file while editing -
:w newname
- to create a copy.
- Start editing the new copy -
:e#
.
- (Optionally) remove the old copy -
:!rm oldname
.
On Windows, the optional 3rd step changes a little:
- (Optionally) remove old Windows copy -
:!del oldname
.