Vim's command to create a new file with the same content of any other file
Say, there is a file first.txt and I want to make a new file second.txt with the same content of first.txt, is there a direct command in Vim to do that?
I don't want to first create second.txt and then copy the content of first.txt.
Just open first.txt
and run the command:
:w second.txt
Although the straightforward simple answer has already been posted, I offer a fun and instructive alternative:
:!cp "%" second.txt