Copy the current document to another location in V / Vim

I am wondering if there is a command in V / Vim that will save a backup of the current document in another place (for example, from C: \ to C: \ backup). Any subsequent recording using the ": w" command will still be recorded to the previous location (for example, C :).

Thanks Derek

+3
source share
2 answers

You can specify the file name after :w:

:w /tmp/backup.txt
+6
source

Next, a copy of the current file edited in the foo.txt file will be recorded:

:w foo.txt
+3
source

Source: https://habr.com/ru/post/1740366/


All Articles