Short cut for close HTML tag in Sublime Text 2

I just found out pressing

For Mac: Alt + Command + .

For PC: Alt + .

For Linux: Alt + .

will finish the tag you currently have open.

E.g. you type

<div>

Pressing the shortcut will give you

</div>

Type div and then Tab. It automatically expands to in sublime text 2.


Ctrl + Shift + < which is Edit > Tag > Close Tag

UPDATE

After seeing Rich's answer I remembered that I've changed the shortcut for this command.


You can just type the type of tag you would like to insert and press 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.
  • 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