Short abbreviation for HTML tag in Sublime Text 2

Is there a shortcut to close the HTML tag that you just opened in sublime text 2?

+42
html sublimetext2
Aug 08 '13 at
source share
6 answers

I just discovered a click

For Mac: Alt + Command + .

For PC: Alt + .

For Linux: Alt + .

will complete the tag that you just opened.

eg. you print

<div> 

Clicking a shortcut will give you

 </div> 
+88
Aug 09 '13 at 3:44 on
source share

You can simply enter the type of tag you want to insert and click on the tab!

<strong> Examples:

  • Enter a div , then press Tab to get the <div></div> with the cursor in the contents of the tag, and click the tab again to exit the tag.
  • Type a , then press Tab to get <a href=""></a> with the cursor in quotation marks, the tab again to go to the contents of the tag, and again click on the tab to exit the tag
+46
Aug 08 '13 at
source share

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

+3
Dec 18 '15 at 4:50
source share

I don’t know where other people got their shortcuts from. In my version of Sublime Text 2, this is ALT + COMMAND + . (Mac OS X)

+2
Sep 03 '13 at 15:11
source share

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

UPDATE

After looking at the Rich answer, I remembered that I changed the shortcut for this command.

+1
Aug 09 '13 at 2:26
source share

Install the HTMLAttributes package here, or install it through Settings> Browser Package> Install Package

+1
Apr 03 '14 at 10:28
source share



All Articles