2

Whenever I create a file, Vim also creates a .extension~ file. For example, when I create a main.cpp file, another one appears with main.cpp~. Is the .cpp~ file an older version of my .cpp file? Is there any reason to why Vim does this?

2
  • 3
    Welcome to Vi and Vim! Do you happen to have the 'backup' option enabled? You can check that with :verbose set backup?, which will tell you whether you have it on, and also where in your configs it was enabled.
    – filbranden
    Dec 1, 2020 at 0:12
  • 1
    Adding to @filbranden's comment, read up on the help docs in vim. You can bring it up by pressing :help backup in vim. You can disable backup by pressing :set nobackup in vim or by adding the line set nobackup in your vimrc (typically resides in your home folder).
    – kadekai
    Dec 1, 2020 at 13:36

0

Browse other questions tagged or ask your own question.