Questions tagged [backup]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Backup only certain filetypes

I have set vim.opt.backup = true which keeps permanent backups. (Works as intended thus far.) But I would like to exclude certain filetypes, or, even better, file extensions. (Say, .conf which I ...
Anthony's user avatar
  • 55
2 votes
1 answer

Disabling undodir and backupdir for specific paths

My email client creates files in /tmp and my password manager under /dev/shm when editing. The first is just unnecessary to store the undos for longer than the lifetime of the file, the latter is ...
fbence's user avatar
  • 603
5 votes
2 answers

How can I prevent files in backupdir from overriding similar named files?

In my vimrc I have: set backupdir=~/.cache/vim/backup |call mkdir(&backupdir, 'p', 0o700) set undodir=~/.cache/vim/undo |call mkdir(&undodir, 'p', 0o700) This stores a backup file in ~/....
Martin Tournoij's user avatar
1 vote
1 answer

Why does Vim write backups when it does?

At seemingly random moments, Vim litters my working directory with backup files like foo.bak, despite that nobackup is set. Note that Vim does not litter with foo~ (as it would if backup were set), ...
thb's user avatar
  • 111
0 votes
1 answer

Why are empty files with names as 4 digits being generated by VIM?

I've been using VIM on a virtual machine running Kali Linux to write python scripts on a shared folder on my Windows 10 host operating system, but these empty files with names as 4 digits keep being ...
Hack3r's user avatar
  • 1
4 votes
0 answers

Error when w!riting a file "Can't delete backup file"

I'm having a problem when writing to a file created by another user. When I try to do :w I get the error message E506: Can't write to backup file (add ! to override) and when I do :w! the file get's ...
Moberg's user avatar
  • 113
25 votes
2 answers

How do I disable vim from producing backup files?

How do I disable vim from producing backup files? Like file~ do not generate. Should I do that by modifying /etc/vimrc? I added set nobackup to /etc/vimrc, but when I looked at the distributed file ...
zhiyu fu's user avatar
  • 353
2 votes
1 answer

Auto-Deleting Swaps, Backups and Undos while Quitting vim?

Cluttering Swaps and Backups that I never use are so annoying and takes up unnecessary space. Is there a way to delete them as one quits vim with :q and similar quitting commands?
Paul Kim's user avatar
  • 231
3 votes
1 answer

How can I make backup files start with a dot to make them hidden? (not just tilde)

By default, vim seems to save a backup file ending in a tilde (see :help backup). For example, when editing foobar.txt, a backup file foobar.txt~ is saved. I would like to have it saved to .foobar.txt~...
Flimm's user avatar
  • 2,182
0 votes
0 answers

Are there already a series of switches/commands/aliases to initiate vim and auto backup to new file when writing out

...with confirmation that is somewhat similar to the "you are in RO mode" that you get as a layer of security if you run the command as view. I want a single command [that I may alias to something ...
Rulent's user avatar
  • 1
12 votes
2 answers

What does `nowritebackup` actually do?

I hear somewhere that if backup is disabled and writebackup is enabled, Vim will create backup files for the duration of the edit session and will delete these backup files afterward. However, even ...
john c. j.'s user avatar
5 votes
3 answers

Make backup only once per session, when I close a file

Using the backup option, I'd like vim to keep the backup of a file until that file is closed, instead of overwriting the backup every time the file is saved. I want Vim to do that because I often ...
Arch Stanton's user avatar
3 votes
2 answers

set backupcopy=yes doesn't still writes the file twice

I'm trying to understand and eventually fix the following behavior: when I save a file using VIM, it triggers the change/write event twice. I'm using Ubuntu 16.10, and I created an empty .vimrc file ...
Ionică Bizău's user avatar
3 votes
1 answer

Vim Windows creating temporary files [duplicate]

I am using Vim on windows. Any time I edited a file, Vim is created temporary files. When I created a file, mysql-build-properties.xml Vim is creating files like these: mysql-build-...
ambes's user avatar
  • 183
16 votes
2 answers

Does Vim autosave?

From :help swap-file: Updating the swapfile The swap file is updated after typing 200 characters or when you have not typed anything for four seconds. This only happens if the buffer was ...
Gonçalo Ribeiro's user avatar