Reputation: 4079
Whenever I use the :sav
command, it saves the file with a new name and opens the new file open in Vim.
Is it possible to save the file with a new name but keep the original one open for editing?
Upvotes: 407
Views: 288351
Reputation: 11790
After save new file press
Ctrl-6
This is shortcut to alternate file
Upvotes: 30
Reputation: 1923
The following command will create a copy in a new window. So you can continue see both original file and the new file.
:w {newfilename} | sp #
Upvotes: 7
Reputation: 3969
Thanks for the answers. Now I know that there are two ways of "SAVE AS" in Vim.
Assumed that I'm editing hello.txt.
Upvotes: 301