Re: Backup Directory

Christian Brabandt <[email protected]> Mon, 9 Mar 2026 12:48:20 +0100
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
Please keep the reply on the vim-use list, forwarding to vim-use for=20
reference.

On Mo, 09 M=C3=A4r 2026, CrestChristopher wrote:

> Vim returns no error;
>=20
>     set backupdir=3D"$HOME/.backup" I've also tried
>=20
>     set backupdir=3D"/etc/.backup

This basically is the same as

:set backupdir=3D=20

e.g. because of the double quote acting as a comment character, you are=20
effectively emptying the option value.

You probably want:

:set backupdir=3D~/.backup//

note the trailing double slashes to ensure that backup files are written=20
with full path names, where slashes are replaced by % signs, as=20
documented at :h 'backupdir'. Please also note: I am not hundert percent=20
sure if Vim expands the "~" automatically, but I believe it does. If=20
not, you may want to explicitly spell out your home directory like this:

:set backupdir=3D/home/user/.backup//

Finally please note, you can always check the value by querying the=20
option setting directly:

:set backupdir?

>     set writebackup

This will create a backup, but will delete the backup file after a=20
successful write. Is that what you want? Or do you want to keep the=20
backups in which case you want

:set backup

Thanks,
Christian
--=20
Wenn es etwas ist, das "jeder wei=C3=9F", dann stimmt es garantiert nicht.
		-- Robert Anson Heinlein (Die Leben des Lazarus Long)

--=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/aa6=
zhDZ0gKycJhBe%40256bit.org.