Re: Backup Directory

Christian Brabandt <[email protected]> Mon, 9 Mar 2026 14:57:50 +0100
Newsgroups gmane.editors.vim
Message-ID <aa7R3tRl7Zr/[email protected]>
On Mo, 09 M=C3=A4r 2026, CrestChristopher wrote:

> When I create a file in Vim, save it; a backup should be created after th=
e
> save or after I've saved and added more to the document. In either case n=
one
> of these two are working ?

So I tried this out:

#v+
~/tmp/$ mkdir ~/vim-backup
~/tmp/$ cat backup.vim
set nocp
set backupdir=3D~/vim-backup//
set backup
~/tmp/$ vim --clean -u backup.vim
:e ~/.vim/vimrc
:w
:q
~/tmp/$ ls -l ~/vim-backup/
-rw-r--r-- 1 chrisbra chrisbra 12481 Jan 20  2025 %home%chrisbra%.vim%vimrc=
~
#v-

Works as expected.


Thanks,
Christian
--=20
Death is God's way of telling you not to be such a wise guy.

--=20
--=20
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

---=20
You received this message because you are subscribed to the Google Groups "=
vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_use/aa7=
R3tRl7Zr/fA%2BT%40256bit.org.