2010-08-12 159 views
12

Eclipse在哪里存储其用户首选项?特别是键盘绑定?Eclipse存储键盘绑定在哪里?

+0

相关http://stackoverflow.com/questions/3462216/aptana-keyboard-shortcut-for-html-js-jquery-preview-within-the-ide(未回答) – ina 2010-08-12 19:24:45

+0

我认为这是OP问在哪里设置本身被存储,即。在'〜/ .eclipse','$ project_path/.settings'等。 – prodigitalson 2010-08-12 19:27:20

回答

25

当你关闭Eclipse,关于快捷键(设置,从默认配置不同)的任何地方设置保存在

</path/to/workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings\ 
org.eclipse.ui.workbench.prefs 
+0

救命恩 - 谢谢! – 2012-07-09 21:22:56

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: ${[email protected]} | \tElementID : [email protected]"; 

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 = [email protected]; 
    keys = [email protected]; 
    workbench.commands.each 
    {commandIt-> 
     def thisCommand = commandIt.attributes()['{http://www.omg.org/XMI}id']; 
     if(thisCommand.equals(command.toString())) 
     { 
      commandName = [email protected]; 
      description = [email protected]; 
      category = [email protected]; 
      workbench.categories.each 
      {workbenchIt-> 
       if(workbenchIt.attributes()['{http://www.omg.org/XMI}id'].equals(category.toString())) 
       { 
        name = [email protected]; 
       } 
      } 
     } 
    } 
    println "\t\tKeys: ${keys}\tCommand: ${commandName}"+ 
      "\tDescription: "+description+"\tName: "+name; 
} 
} 
0

实际上,你可以只是整条生产线复制在org.eclipse.ui.workbech.prefs文件开头:org.eclipse.ui.commands= 并粘贴到其他相应的eclipse工作区首选项文件要更新 - 至少在Eclipse Neon中,您将立即得到它们。