簡體   English   中英

如何在 Sublime Text 中為所選文本綁定一個鍵?

[英]How to bind a key for selected text in Sublime Text?

所以我有一個文本,例如“ this is sample text ”,我希望它變成這樣“ <![CDATA[this is sample text]]>

我想像這樣使用這個功能:我選擇任何文本並使用ctrl+t等熱鍵。

我使用 Sublime Text 3。

我該如何選擇文本?

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM