Eclipse在哪里存储其用户首选项?特别是键盘绑定?
答案 0 :(得分:26)
关闭Eclipse时,关于快捷键的任何本地设置(与默认配置不同的设置)都保存在
中</path/to/workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings\
org.eclipse.ui.workbench.prefs
答案 1 :(得分:0)
您可以使用以下groovy脚本提取绑定。我不是一个时髦的开发者,所以请原谅我的黑客。
使用Groovy脚本(替换为工作台xmi文件的正确路径):
workbench = new XmlSlurper().parse("<path to eclipse>/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi")
List bindingTables
workbench.bindingTables.each
{ it->
//println "\tContributorURI: ${it.@contributorURI} | \tElementID : it.@elementId";
def command = "command";
def commandName = "commandname";
def description = "description";
def category;
def name = "name";
def keys = "keys";
it.bindings.each
{bindingIt->
//loop through every binding entry
command = bindingIt.@command;
keys = bindingIt.@keySequence;
workbench.commands.each
{commandIt->
def thisCommand = commandIt.attributes()['{http://www.omg.org/XMI}id'];
if(thisCommand.equals(command.toString()) )
{
commandName = commandIt.@commandName;
description = commandIt.@description;
category = commandIt.@category;
workbench.categories.each
{workbenchIt->
if(workbenchIt.attributes()['{http://www.omg.org/XMI}id'].equals(category.toString()) )
{
name = workbenchIt.@name;
}
}
}
}
println "\t\tKeys: ${keys}\tCommand: ${commandName}"+
"\tDescription: "+description+"\tName: "+name;
}
}
答案 2 :(得分:0)
您实际上只需复制以org.eclipse.ui.workbech.prefs
文件开头的整个行:org.eclipse.ui.commands=
并将其粘贴到您想要更新的另一个相应的eclipse工作空间prefs文件中 - 至少在Eclipse Neon中,并且您将立即获取它们。