-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

相关问题