On Fri, Jun 12, 2009 at 8:05 AM, Teemu Likonen wrote:
>
> On 2009-06-12 04:18 (-0700), Amit Debnath wrote:
>
>> When I'm opening a file using vim and write and close the file , The
>> temporary file named filename~ is not getting deleted even after I
>> close the file after editing and saving.. Any solution to the problem?
>
> It's not a temporary file, it's a backup file. You can control how Vim
> handles backup files with 'backup', 'writebackup' and a couple of other
> settings. For more info, see:
>
>    :help backup

To clarify slightly:

The default settings are to make a backup of the original file when
writing out a new file, and to delete that backup when the write
completes successfully.  This is good, it stops you from losing data
should something ever go wrong, so it's not a good idea to disable the
'writebackup' option unless you really know what you're doing.

There is another option, 'backup', that causes vim to create the
backup files like normal, but to not delete them even after a
successful write.  Your distro must be enabling this in their
systemwide vimrc.  To disable it, it should be enough to just put

  set nobackup

into your vimrc.

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to