views:

580

answers:

4

We use Eclipse with projects in CVS. It has proven to be the simplest to create a new workspace when having to deal with another branch or application, and then use Team -> Import project set to get all the needed projects from CVS.

Unfortunately, I then have to do the following each and every time:

  • Change text font to Consolas 11 pt
  • Disable spell checking in text editors
  • Run everything in the background

plus some more of the same.

I'd like to change the standard values once and for all in the Eclipse distribution files after having unzipped the distribution (Windows). Where are these defaults located inside Eclipse?


EDIT: For now we just have a preference file which must be read in. An extra step, but works...

+1  A: 

Try checking:

<workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings

Some .prefs files could be interesting to copy from one workspace to the next.
(like org.eclipse.team.cvs.ui.prefs which contains any non-default value for CVS settings)


I want to fix the defaults inside Eclipse so the workspace is created with the defaults I want every time.

Hard core solution:

Change the .options file within <eclipse-SDK-3.5-win32>\eclipse\plugins\org.eclipse.team.cvs.core_3.3.200.I20090430-0408.jar (that is the name I have for eclipse3.5)
That is the file with the default values, at least for CVS.

VonC
I do not want to fix the created workspace after creation. I want to fix the defaults inside Eclipse so the workspace is created with the defaults I want every time. Suggestions?
Thorbjørn Ravn Andersen
@Thorbjørn: I'm not sure if that is possible without digging up the Eclipse source. But you might find the script located at http://eclipse.dzone.com/news/create-new-eclipse-workspace-w to be useful.
Vineet Reynolds
+3  A: 

You can export your settings from a workspace and import them into any other (this basically does what VonC's answer says, but with some measure of error checking).

To do so, in the source workspace select File->Export...->General->Preferences, then select Export All and enter a file to export to, then Finish.

You can then import the preferences into any workspace by doing File->Import...->General->Preferences, browse to the preferences file and hitting Finish.

Rich Seller
does this also import fonts,spell check preferences etc?
Narayan
It will export the references to those files, so if you had a user dictionary in c:\user.dict, you'll see an entry like this: /instance/org.eclipse.jdt.ui/spelling_user_dictionary=c\:\\user.dict
Rich Seller
Sometimes to get new developer/machine set up quickly we just copy workspace directory from existing installation, but what you said seems to be more proper way to do it.
xsaero00
+1  A: 

I have created a clean workspace with all settings i want to have. This workspace i have copied into a save folder i will never delete ;)

When i want to create a workspace for a new project, i copy the confugured workspace and thats it.

I have than configured the svn repository path, code format (you also can import preferences in eclipse for this), view configuration and so on.

Markus Lausberg
A: 

When importing preferences (Rich Seller's approach above), especially those that were created by someone else, make sure you backup your Eclipse environment first. That's easy, since it's portable - just copy it to a temporary location.

I've totally hosed my Eclipse environment importing preferences in the past, and importing my own preferences, which I exported just prior to importing, did not fix my issues.