46

How can I apply Eclipse preferences to all Eclipse workspaces?

For example if I go:

Window -> Preferences -> General -> Keys -> Add a Shortcut

I would like to use that shortcut in all of my Eclipse workspaces (different projects). Is there a way to apply preferences to all workspaces?

I would also like to configure what perspectives come up by default when I start a new workspace.

Yuri
  • 4,254
  • 1
  • 29
  • 46
sixtyfootersdude
  • 25,859
  • 43
  • 145
  • 213

1 Answers1

64

If you want preserve all your settings, simply copy the

.metadata/.plugins/org.eclipse.core.runtime/.settings 

directory into your desired workspace directory

You can also export the preferences you set in the template workspace and then import them into other workspaces. This is the preferred method supported by Eclipse.

Go to

File->Export then choose General->Preferences

click Next then select the “Export all” radio button and fill in or browse to a file path where you want to save the preferences . Click Finish and your preferences are exported to that file.

Select

File->Switch Workspace,>… to switch to a different workspace.

When Eclipse restarts in the new workspace select File->Import then General->Preferences click Next and browse to your saved preferences file and click Finish to import your preferences into the current workspace.

bilash.saha
  • 7,226
  • 2
  • 35
  • 40
  • 24
    +1, That works... But it isn't a great solution. I don't want to do that to 20 workspaces just to move around a couple shortcuts. – sixtyfootersdude Oct 28 '11 at 19:41
  • 1
    Why is the _core_ a plugin? – masterxilo May 02 '14 at 14:04
  • I just did it for my key board short cut. worked perfect thanks :) – Paul Phoenix Dec 21 '15 at 05:50
  • 7
    Eclipse needs a complete preferences overhaul to support this obviously common pattern. It's currently so messy and brittle, there are dozens of plugins folders, the core one alone has 50 prefs files, and if you try to coordinate across workspaces you end up with a perpetual merge mess. Has anyone tried to version-control their preferences? Maybe that would help. – moodboom Apr 01 '16 at 15:38
  • 1
    An alternative (if you're on unix/linux) is to create a symlink (using "ln -s") rather than copying. This is to ensure that any changes you make will be propagated across all workspaces). Note: Also agree with moodboom that this is an annoying problem that eclipse needs to solve. – gav.newalkar Jan 24 '18 at 21:07
  • 1
    Eclipse reasoning was probably like having different workspaces for completely different _Eclipses_ - one for C/C++ CDT, another one for Java, etc. So it would make sense to separate the config. But still... – Yuri Aug 01 '20 at 17:25
  • yeah, but it would've been nice if one could have an option to say ... this is a setting that I want globally rather than for this workspace only – Lohmar ASHAR Feb 28 '23 at 22:10