You are not logged in.

#1 2008-11-09 04:20:45

nterpol
Member
Registered: 2008-05-02
Posts: 6

Saving a file in Vi creates same file but with ~ added [SOLVED]

Hi,

I'm not sure if I pressed a key combination, but when I save a file in Vi I get another file that has the same name as the original file but with the ~ character added to the end of the filename.  For example, if I edit foo.txt and save it, then the original will be saved, but I'll also get a new file named foo.txt~.  Does anyone know how to fix this?

Thanks!

-nterpol

Last edited by nterpol (2008-11-09 12:30:59)

Offline

#2 2008-11-09 04:28:04

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Saving a file in Vi creates same file but with ~ added [SOLVED]

Offline

#3 2008-11-09 12:30:45

nterpol
Member
Registered: 2008-05-02
Posts: 6

Re: Saving a file in Vi creates same file but with ~ added [SOLVED]

It worked!  Thanks!

Offline

#4 2008-11-10 03:49:47

ssjlegendx
Member
Registered: 2008-01-01
Posts: 94
Website

Re: Saving a file in Vi creates same file but with ~ added [SOLVED]

I think that the default backup settings (in /etc/virc if you use the basic vi package) changed with the recent upgrade to Vim 7.2.25.

For information on file backup setting combinations, see :help backup-table in Vim.


Edit:

fwojciec wrote:

That article advocates disabling the use of swap files (:set noswapfile); however, I wouldn't recommend it. Whereas backup files are designated with a trailing tilde (~), swap files have names ending with .swp. The latter should be removed automatically when Vim exits (unless it is exited abnormally, such as when the user closes a terminal emulator without first quitting an instance of Vim that is running inside it).

Last edited by ssjlegendx (2008-11-10 04:13:24)


#!/vim/rocks

Offline

Board footer

Powered by FluxBB