2010-08-12 56 views
12

Eclipse lưu trữ các tùy chọn người dùng của nó ở đâu? Cụ thể là các ràng buộc bàn phím?Eclipse lưu trữ các ràng buộc bàn phím ở đâu?

+0

liên quan đến http://stackoverflow.com/questions/3462216/aptana-keyboard-shortcut-for-html-js-jquery-preview-within-the-ide (chưa được trả lời) – ina

+0

Tôi nghĩ rằng thw OP đang hỏi nơi các cài đặt được lưu trữ tức là. trong '~/.eclipse',' $ project_path/.settings' vv .. – prodigitalson

Trả lời

25

Khi bạn đóng Eclipse, bất kỳ cài đặt địa phương về phím tắt (cài đặt khác với cấu hình mặc định) được lưu trong

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

Lifesaver - cảm ơn! –

0

Bạn có thể trích xuất các ràng buộc bằng cách sử dụng kịch bản hấp dẫn sau đây. Tôi không phải là một nhà phát triển groovy vì vậy xin vui lòng tha thứ hack của tôi.

Groovy Script sử dụng (thay thế trong một con đường đúng vào file XMI workbench):

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

Bạn có thể thực sự chỉ cần sao chép toàn bộ dòng trong file org.eclipse.ui.workbech.prefs mà bắt đầu với: org.eclipse.ui.commands= và dán nó vào tập tin prefs workspace eclipse tương ứng khác mà bạn muốn cập nhật - ít nhất là trong Eclipse Neon, và bạn sẽ nhận được tất cả chúng cùng một lúc.

Các vấn đề liên quan