Is there a global setting to prevent all text editors from creating backup files? I'm sick of changing it in 11 different places.

  • Converted alex's answer to a comment: "But these backups could save you life one day :)" – Michael Mrozek Oct 18 '10 at 5:12
  • I save my important stuff to dropbox. It just makes a mess to have versions of backups stored to dropbox =P – Falmarri Oct 18 '10 at 5:19
  • 1
    You just have to wait until dropbox allows you to ignore all those files :-) dropbox.com/votebox/648/ignore-file – Marcel Stimberg Oct 18 '10 at 13:29
  • Or you could just write a script that just automatically removes all files matching *~ – Seamus Oct 18 '10 at 15:26
  • Instead of turning them off, consider putting them in a designated temp folder. That solves your dropbox problems while keeping the backup files around if you ever need them. I know emacs will let you do this, can't speak for any other editors. – Kevin Oct 18 '10 at 21:58

This actually makes a rather strong argument for "learn one editor well".

FWIW, the .vimrc statement would be "set nobackup".

| improve this answer | |
  • Thanks for the vim setting. That's the one that really matters I guess since most other editors can be changed in menus. – Falmarri Oct 18 '10 at 18:12
  • Downvotes? Seriously? – user455 Oct 19 '10 at 15:45

As far as I know, there is no single environment variable or configuration setting that is checked by every UNIX editor.

For Emacs, you can turn off file backups for all files by inserting this into your ~/.emacs:

(setq backup-enable-predicate (lambda (path) nil))

GEdit has a boolean configuration key /apps/gedit-2/preferences/editor/save/create_backup_copy that you can set with gconf-tool.

I'm quite sure there are as many ways to turn backups off as there are editors. :-)

| improve this answer | |

As others have said, there is no cross-editor configuration options. But, here is one pathological solution:

  1. Write a script that does something like the following:

    find / -iname "*~" -exec rm {} \;
  2. Add this script as a cron job that runs every so many minutes.

If you are just interested in keeping your dropbox folder clean, change the / to the appropriate folder. I'll bet an even more interesting solution can be created by using incron.

| improve this answer | |

There is an environment variable VERSION_CONTROL which works for Emacs and other Gnu utilities (unless some gnome inside my computer has been fooling me or something). Whether this works for other things I don't know.

| improve this answer | |

Use a read-only filesystem.

| improve this answer | |
  • That's not even close to an answer – Falmarri Oct 19 '10 at 17:57
  • One of the only reasonable motives to avoid creating '~' files is to avoid writing to the filesystem, right? – Kevin Cantu Oct 19 '10 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.