Switch to a newly saved path
:saveas draft-v2.txt
Example
Normal mode. The existing file draft.txt is open with unsaved edits. draft-v2.txt does not exist.
Before
Current file: draft.txt
Buffer: unsaved changes
- :saveas draft-v2.txt<CR> Save and continue in draft-v2.txt · old file stays on disk
After
Current file: draft-v2.txt
Buffer: saved
Old draft.txt: still on disk
Details & Vim help
Write the buffer to a new file and make that path its current name.
Continue editing a new version while retaining the old file.
This writes a file immediately. An existing destination needs an explicit overwrite decision. :write other.txt writes a copy but normally keeps the current buffer name.
:saveas writes the new file and changes the current buffer’s name.
Try it in Vim
- Run :saveas draft-v2.txt<CR>.
- Check :file to confirm the current buffer’s new path.
- Continue editing and use :write for later saves.