windows 在哪里调整 Eclipse 以更改创建新工作区时使用的默认设置?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1311720/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where to tweak an Eclipse to change the default settings used when creating a new Workspace?
提问by Thorbj?rn Ravn Andersen
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.
我们将 Eclipse 与 CVS 中的项目一起使用。事实证明,当必须处理另一个分支或应用程序时,创建一个新的工作区是最简单的,然后使用 Team -> Import project set 从 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
- 将文本字体更改为 Consolas 11 pt
- 在文本编辑器中禁用拼写检查
- 在后台运行一切
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?
我想在解压发行版 (Windows) 后在 Eclipse 发行版文件中一劳永逸地更改标准值。这些默认值在 Eclipse 中的什么位置?
EDIT: For now we just have a preference file which must be read in. An extra step, but works...
编辑:现在我们只有一个必须读入的首选项文件。一个额外的步骤,但有效......
EDIT 2014: I've ended up creating a workspace with the settings I want, and then creating a new copy everytime I need a new one. Also handles Maven Central information etc. Accepted the oldest answer saying essentially this.
编辑 2014:我最终使用我想要的设置创建了一个工作区,然后在每次需要一个新副本时创建一个新副本。还处理 Maven 中央信息等。接受了最古老的答案,基本上就是这样。
采纳答案by Markus Lausberg
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.
我已经配置了 svn 存储库路径、代码格式(您也可以为此在 eclipse 中导入首选项)、查看配置等。
回答by Rich Seller
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).
您可以从工作区导出您的设置并将它们导入到任何其他工作区(这基本上按照 VonC 的回答进行操作,但会进行一些错误检查)。
To do so, in the source workspace select File->Export...->General->Preferences, then select Export Alland enter a file to export to, then Finish.
为此,在源工作区中选择File-> Export...-> General-> Preferences,然后选择Export All并输入要导出到的文件,然后选择Finish。
You can then import the preferences into any workspace by doing File->Import...->General->Preferences, browse to the preferences file and hitting Finish.
然后,您可以通过执行File-> Import...-> General-> Preferences,浏览到首选项文件并点击Finish将首选项导入任何工作区。
回答by VonC
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)
将某些.prefs
文件从一个工作区复制到下一个工作区可能会很有趣。
(例如org.eclipse.team.cvs.ui.prefs
包含 CVS 设置的任何非默认值)
I want to fix the defaults inside Eclipse so the workspace is created with the defaults I want every time.
我想修复 Eclipse 中的默认值,以便每次都使用我想要的默认值创建工作区。
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.
更改其中的.options
文件<eclipse-SDK-3.5-win32>\eclipse\plugins\org.eclipse.team.cvs.core_3.3.200.I20090430-0408.jar
(即我对 eclipse3.5 的名称)
这是具有默认值的文件,至少对于 CVS。
回答by Ali H
Here's what I do:
这是我所做的:
- Start up Eclipse
- Without importing or starting any projects, edit the workspace and make all the config changes you want
- Open up the workspace in windows explorer and create a copy of the folder.
- Then, any time you wish to use it, copy this folder to your new workspace folder location - you may need to create the new workspace folder first (and definitely call it something different.)
- 启动 Eclipse
- 无需导入或启动任何项目,即可编辑工作区并进行所需的所有配置更改
- 在 Windows 资源管理器中打开工作区并创建文件夹的副本。
- 然后,任何时候您想使用它时,将该文件夹复制到您的新工作区文件夹位置 - 您可能需要先创建新的工作区文件夹(并且绝对称它为不同的名称。)
This is what I do anyway. Yes, it's very dirty but it does get what I want pretty quickly!
无论如何,这就是我所做的。是的,它很脏,但它确实很快就能得到我想要的东西!
回答by user160383
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.
在导入首选项(上面的 Rich Seller 的方法)时,尤其是那些由其他人创建的首选项时,请确保首先备份 Eclipse 环境。这很容易,因为它是便携的——只需将它复制到一个临时位置。
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.
过去我已经完全解决了我的 Eclipse 环境导入首选项,并且导入我自己的首选项(我在导入之前导出)并没有解决我的问题。
回答by Faheem
Fix the defaults inside Eclipse so the workspace is created with the defaults, If you want every time suggestions, then
修复 Eclipse 中的默认值,以便使用默认值创建工作区,如果您每次都想要建议,则
Go to eclipse extract path -eclipse\configuration\.settings
-> Edit -org.eclipse.ui.ide
->
Change value to true: SHOW_WORKSPACE_SELECTION_DIALOG=true
转到 eclipse 提取路径-eclipse\configuration\.settings
-> 编辑-org.eclipse.ui.ide
-> 将值更改为 true:SHOW_WORKSPACE_SELECTION_DIALOG=true
Similarly in this file you can directly change other default settings.
同样,在此文件中,您可以直接更改其他默认设置。
回答by user3827853
I find a way to do that:
我找到了一种方法来做到这一点:
open <eclipse>\plugins\org.eclipse.cpp.package.cpp_1.4.2.201210131-1456\plugin_customization.ini
and add
并添加
folding
折叠式的
org.eclipse.cdt.ui/editor_folding_enabled=true
org.eclipse.cdt.ui/editor_folding_preprocessor_enabled=true
then new project will enable folding by default.
那么新项目将默认启用折叠。
So
所以
You need to know where your prefer locate, in my case, folding is under
org.eclipse.cdt.ui
, you can try on an project then check<workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings
to find it"org.eclipse.cpp.package.cpp_1.4.2.201210131-1456"
should be variable depends on what version you use. whatever it's, you should find"plugin_customization.ini "
您需要知道您喜欢的位置,在我的情况下,折叠在 下
org.eclipse.cdt.ui
,您可以尝试一个项目然后检查<workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings
以找到它"org.eclipse.cpp.package.cpp_1.4.2.201210131-1456"
应该是可变的,取决于您使用的版本。不管是什么,你应该找到"plugin_customization.ini "