2017-08-09 83 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中。 –

相关问题