[英]HTML keyboard shortcuts in Sublime Text 2?
I switched from Textmate to Sublime in the past few months and have been busy trying to re-train my brain and fingers to use the new shortcut keys. 在过去的几个月里,我从Textmate切换到了Sublime,并且一直忙于尝试重新训练我的大脑和手指以使用新的快捷键。
In Textmate, when editing an HTML documents, I could highlight text and do Command + b to wrap the selected text in <b></b>
tags or Command + i to wrap in <i></i>
...among various other commands/tags. 在Textmate中,当我编辑HTML文档时,我可以突出显示文本并执行Command + b将所选文本包装在
<b></b>
标记中,或者执行Command + i以包装<i></i>
...各种其他命令/标签。
So, is there a way to do that in Sublime? 那么,有没有办法在Sublime中做到这一点? I know I can type b , TAB to create an empty set of
<b></b>
tags, but I want to be able to wrap selected text in various tags. 我知道我可以输入b , TAB来创建一组空的
<b></b>
标签,但我希望能够将所选文本包装在各种标签中。
Mac: 苹果电脑:
Ctrl + Shift + W Ctrl + Shift + W
Windows/Linux: 在Windows / Linux的:
Alt + Shift + W Alt + Shift + W.
Then type which tag you want ( i
, b
, etc.). 然后键入您想要的标签(
i
, b
等)。
{ "keys": ["super+alt+b"], "command": "insert_snippet", "args": {"contents": "<strong>${0:$SELECTION}</strong>" } },
{ "keys": ["super+alt+i"], "command": "insert_snippet", "args": {"contents": "<em>${0:$SELECTION}</em>" } }
Above can be added to user key bindings file to have selection surrounded by strong tags upon pressing Cmd+Alt+b and by italic tags upon pressing Cmd+Alt+i (on Mac). 可以将上面的内容添加到用户键绑定文件中,以便在按下Cmd + Alt + b时使用强标记包围选择,并在按下Cmd + Alt + i(在Mac上)时使用斜体标记。
Source: https://gist.github.com/3436510 资料来源: https : //gist.github.com/3436510
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.