Autocomplete html tag after pressing enter from dropdown


#1

I just switched to Atom (or trying to) from Sublime. In Atom, when you start with a ‘<’ it suggests the most common or most used tags as a drop-down like any other editors, but unlike Sublime when you enter or select a tag it does not autocomplete the tag pair. For example,

If I type:
<di
then select ‘div’ and press enter Atom stops at
<div
whereas Sublime completes it

Is there any existing packages that does that. Or is there a way to do it in settings?


#3

After “whereas Sublime completes it” its

<div></div>

(Cannot edit post as I am not level 1 yet :frowning_face: )


#4

Pressing TAB should do what you expect, else…


#5

I have tried with Tab and Enter and played with the option you mentioned. But the only time it auto-completes is after selecting from the drop-down and type ‘>’ unlike sublime where after enter or tab it auto-completes the tags as mentioned above.


#6

Try the autoclose-html package.


#7

I have miss-understood your question - sorry.
I do understand your question now after the suggestion by @Wliu (thanks).

The above suggestion was for the snippet when starting to type div,
which brings up the autocomplete selection for

<div class="">
  
</div>

To hook onto this conversation, I came across something strange.

The snippet for HTLM worked for Atom V1.21.1 but not for V1.22-beta1.
Below is triggering “all snippets” in HTML text, beta version on the left.

The packages used is the same (in name) when it comes to autocomplete, snippets and HTLM themes.


#8

There’s an HTML snippets bug in 1.22. It should be fixed by the time it reaches stable.