How do you set up Sublime Text 2 so that typing a .
(period) produces class=" "
and #
(hash) produces id=" "
when typing an opening HTML tag?
The shortcut key for this purpose is Ctrl+Shift+P for Windows and Cmd+Shift+P for Mac.
Sublime Text contains a custom HTML and CSS engine, named minihtml, for displaying stylized content in editor panes. HTML content can be displayed in both popup windows and phantoms.
Type foo.bar, press Tab, and you'll get
<foo class="bar"></foo>
There's also foo#bar (for id instead of class). Both are implemented in Packages/HTML/html_completions.py
I found the answer. Go to: Preferences -> Setting -> User.
add the following text between the curly braces, then save the file:
"auto_id_class": true,
this allows you to add id=" "
and class=" "
into HTML tags quickly, just by typing a #
or .
If you use sublime text it's a nice feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With