Saturday, August 6, 2011

Re: emacs-style file backups

I looked at patchmode before, but it doesn't do what I want. patchmode only keeps the oldest version of the file. So it will save the backup after the first write. However, if you kill the buffer and then visit the file again, a new backup file will not be made.

I want a new backup file only when I first open up a file in a buffer and save it the first time. But after I close the buffer and reopen it again later, I want it to write another backup.

On Sun, Aug 7, 2011 at 1:59 AM, Ben Fritz <fritzophrenic@gmail.com> wrote:


On Aug 7, 12:10 am, Alan <bowl.of.petun...@gmail.com> wrote:
> Hi,
>
> I turned on file backups using "set backup" in my .vimrc. However, I want to
> have emacs-style file backup behavior:
>
> "Emacs makes a backup for a file only the first time the file is saved from
> a buffer. No matter how many times you subsequently save the file, its
> backup remains unchanged. However, if you kill the buffer and then visit the
> file again, a new backup file will be made."
>
> Is there anyway for vim to do this? Or has anyone written any scripts to do
> this?
>
> (Vim's backups just write an additional "filename~" every time you save the
> file, regardless if it was the first save.)
>

:help 'patchmode'

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: