2010-08-12 62 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中,您將立即得到它們。