简体   繁体   English

Sublime Text 2 中关闭 HTML 标签的快捷方式

[英]Short cut for close HTML tag in Sublime Text 2

是否有关闭您刚刚在 sublime text 2 中打开的 HTML 标签的快捷方式?

I just found out pressing我刚发现按

For Mac: Alt + Command + .对于 Mac: Alt + Command + .

For PC: Alt + .对于 PC: Alt + .

For Linux: Alt + .对于 Linux: Alt + .

will finish the tag you currently have open.将完成您当前打开的标签。

Eg you type例如你输入

<div>

Pressing the shortcut will give you按快捷键会给你

</div>

You can just type the type of tag you would like to insert and press tab!您只需输入要插入的标签类型,然后按 Tab 键即可!

Examples:例子:

  • Type div then press Tab to get <div></div> with the cursor in the tag's content, and tab again to exit the tag.输入div然后按Tab得到<div></div>光标在标签的内容中,再次按Tab退出标签。
  • Type a then press Tab to get <a href=""></a> with the cursor in the quotes, tab again to move to the tag's content, and tab again to exit the tag键入a然后按Tab获取<a href=""></a>光标在引号中,再次按Tab移动到标签的内容,再次按 Tab 退出标签

Type div and then Tab.键入 div,然后键入 Tab。 It automatically expands to in sublime text 2.它会自动扩展到 sublime text 2。

Ctrl + Shift + < which is Edit > Tag > Close Tag Ctrl + Shift + < 即编辑 > 标签 > 关闭标签

UPDATE更新

After seeing Rich's answer I remembered that I've changed the shortcut for this command.看到 Rich 的回答后,我记得我已经更改了此命令的快捷方式。

Not sure where the other people got their shortcuts from.不知道其他人从哪里得到他们的捷径。 On my version of Sublime Text 2, it's ALT + + .在我的 Sublime Text 2 版本中,它是ALT + + (Mac OS X) (Mac OS X)

在此处安装“HTMLAttributes”包或通过首选项 > 包资源管理器 > 安装包进行安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM