Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialWill Lam
7,027 PointsHow did you guys automatically close the <tr> and <td>, <table> tag etc in Sublime Text?
It was rather abrupt, but I couldn't catch what Fabio did. That would save a ton of time if we knew how to do that (and avoid errors as well)
2 Answers
James Ingmire
11,901 PointsYou have to save the file first as 'example.html' or 'example.css' or what ever language you're writing and then when you start to enter </ the closing tag will auto fill.
Kristian Terziev
28,449 PointsIt is the auto completion feature in Sublime text. Be sure to do this:
You must save the new file you have opened as the file type you are gonna work with (.css for CSS, .html or .php for HTML & PHP, etc.). If you have opened an existing file, be sure that the Language that Sublime Text is trying to read is the same as the file's. You can check which language the programm is using from the menu View->Syntax.
If the issue wasn't soved from that, check if your auto complete feature is turned on. You can open the settings from Preferences->Settings (Default or User), go to line 214 and it should look something like this:
// Enable auto complete to be triggered automatically when typing.
"auto_complete": true,
// The maximum file size where auto complete will be automatically triggered.
"auto_complete_size_limit": 4194304,
// The delay, in ms, before the auto complete window is shown after typing
"auto_complete_delay": 50,
// Controls what scopes auto complete will be triggered in
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
// Additional situations to trigger auto complete
"auto_complete_triggers": [ {"selector": "text.html", "characters": "<"} ],
// By default, auto complete will commit the current completion on enter.
// This setting can be used to make it complete on tab instead.
// Completing on tab is generally a superior option, as it removes
// ambiguity between committing the completion and inserting a newline.
"auto_complete_commit_on_tab": false,
// Controls if auto complete is shown when snippet fields are active.
// Only relevant if auto_complete_commit_on_tab is true.
"auto_complete_with_fields": false,
// Automatically close HTML and XML tags when </ is entered.
"auto_close_tags": true,
Don't just copy and paste it in because something might go wrong. See if these settings are matching with yours first.
Nkosi Ndlovu
9,652 PointsNkosi Ndlovu
9,652 PointsHaven't seen the video but I'm assuming it's the auto completion you are talking about. If it is, then you might want to look into Emmet http://emmet.io/