Search code examples
eclipseeclipse-cdtautosave

How to configure Eclipse to "autosave before build" by default?


I am working with Eclipse (Indigo) to develop C projects. When I create a new C project in a new workspace, by default the "Autosave before build" option is not set. This is extremely frustrating, as autosave is usually the default behavior in other IDE's I worked on. I change some code, build and nothing seems to go as expected - until I remember that the option is not set...

Is there a way to make Eclipse open a new workspace with this option set?


Solution

  • Create a file named default.ini, or some other name, containing the following line:

    org.eclipse.ui.ide/SAVE_ALL_BEFORE_BUILD=true
    

    In your eclipse.ini file which already exists, add the following lines somewhere before the -vmargs line:

    -pluginCustomization
    /path/to/default.ini
    

    Where /path/to/default.ini is the full path to the default.ini file you created in the first step. If Eclipse will be used by multiple users on this machine, default.ini should be accessible by all of them.