2017-08-09 81 views

回答

0

打開命令選項板(Ctrl+Shift+P),然後選擇XPath: Query document。這將打開「Enter xpath」輸入面板。

默認情況下,XPath插件沒有設置鍵綁定。 Example.sublime-keymap文件顯示了您可能想要設置的示例。

Example.sublime-keymap文件中標記爲「顯示XPath查詢輸入框」的底部示例是顯示「Enter xpath」輸入面板的鍵綁定,它使用的鍵是Ctrl+Shift+Alt+Super+q將很難按下很明顯,作者希望用戶改變它們。仔細查看示例鍵綁定的內容,然後將所需的內容粘貼到您的用戶密鑰文件中,然後將它們使用的密鑰更改爲您希望的密鑰。

例如,您可能要添加以下綁定到您的用戶密鑰,以顯示「輸入的XPath」的提示與Ctrl+Shift+X鍵:

注意:注意有幫助的行這樣一個從下面的例子: "prefill_query": "//text()", // an XPath query to put into the input box by default - can omit and use "prefill_path_at_cursor": true instead to use the path of the node under the first cursor。您可能需要添加2個不同的鍵綁定以顯示「輸入xpath」提示;一個使用"prefill_query": "//text(),",另一個使用"prefill_path_at_cursor": true,

// Show the XPath query input box 
{ 
    "keys": ["ctrl+shift+x"], 
    "command": "query_xpath", 
    "args": { 
     "prefill_query": "//text()", // an XPath query to put into the input box by default - can omit and use "prefill_path_at_cursor": true instead to use the path of the node under the first cursor 
     "live_mode": true, // as per settings 
     "normalize_whitespace_in_preview": false, // as per settings 
     "intelligent_auto_complete": true, // as per settings 
     "goto_element": "names", // same options available as for goto_relative 
     "goto_attribute": "value", // options are name, value, entire 
     "max_results_to_show": 1000 // as per settings 
    } 
}, 
+0

我打開命令調色板(CP),即使我已經安裝了XPath的插件(我打開CP驗證它,發現它在「包控制:列表包」),沒有其他的選擇,除了「set語法: Xpath 1.0「在CP中。 –

相關問題