-1

所以,我有例如「this is sample text」一文中,我希望它成爲這個「<![CDATA[this is sample text]]>如何綁定Sublime Text中選定文本的鍵?

我要工作這個函數是這樣的:我選擇任何文本和使用熱鍵像Ctrl + T鍵左右。

我用崇高的文本3

如何爲文本的選擇做到這一點?

回答

1

您可以創建一個新的鍵綁定,以使用insert_snippet命令來包裝您的選擇。 (首選項菜單 - >鍵綁定)

{ "keys": ["ctrl+t"], "command": "insert_snippet", "args": {"contents": "<![CDATA[${0:$SELECTION}]]>"}, "context": 
    [ 
     { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, 
    ] 
}, 
+0

完美的作品!謝謝! – Linas

相關問題