Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question
    
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
add comment

5 Answers

up vote 4 down vote accepted

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

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

share|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
add comment

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. :-)

share|improve this answer
add comment

Use a read-only filesystem.

share|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
    
This is really a comment, not an answer to the question. Please use "add comment" to leave feedback for the author. –  Ulrich Dangel Aug 15 '12 at 1:31
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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