Are there any setting...">

Sublime Text 2 - HTML Autocomplete

In ST2, when you type div.foo and then press tab , it goes into <div class="foo"></div>

Are there any settings for autofill?

<div class="foo">
// 4spaces here.
</div>

Thanks.

UPDATED

I did not find a special parameter, but found where you can change the fragment if someone programmed it. In Sublime Text 2 / Packages / HTML / html_completions.py just change

snippet = "<{0} class=\"{1}\">$1$0".format(tag, arg)

to

snippet = "<{0} class=\"{1}\">\n\t$1\n$0".format(tag, arg)

solvable.

+4
source share
2 answers

You must use emmet .... sublime text 2 does not automatically populate the class attribute when you type element.class , which emmet does. I use it ... I like this magic emmetry.

Similarly, you can enter element> to make the second one socket on the first. or # id element to add an identifier instead of a class ...

Here is the complete cheat sheet for emmet for additional completions using the emmet plugin on ST2.

+1
source

Make sure your page is in HTML. You can do this with CTRL + SHIFT + P. Then enter " set html ".

Then you can enter div.class_name and then TAB .

0
source

Source: https://habr.com/ru/post/1479117/


All Articles