
That way, I hope you may get something out of this article even if you’re quite familiar with Visual Studio Code (VS Code from now on). Instead, I’ll try to describe which features I find most useful in my day-to-day work, and in what context. While I don’t think there’s much in the way of prerequisite knowledge needed in order to get something out of this article, my aim is not to go over the basics of a code editor or to list every keyboard shortcut. That said, I do use Emmet and it is worth investigating.Īs for just inserting the doctype for HTML5 in TextMate, just type doctype and Tab.This is not quite an introductory article. Please see bitten's comment for some warranted concerns with this approach. See this Stack post about HTML5's optional tags. Sure, Emmet (as suggests in his answer) gives you something, but html:5 does too much HTML5 does not mandate a html, head, or body tag. Html doesn't tab complete already because there's no good way to anticipate what you would want in your html template. You can read more about advanced Snippet features here. This is a tab stop and your cursor would appear at the $0. Note: I've added "$0" in between your body tags. Now when you type "html" and press tab, your snippet will be inserted. On the drawer there's a field for "Tab Trigger", enter "html" there. In the text area copy and paste your template. Press Command + N to create a new item, select snippet. Press Cmd-N to create a new bundle item, and select Snippet. Select the bundle you want to add a snippet to, e.g. Select Bundles » Edit Bundles… in the TextMate 2 menu. In TextMate these are called snippets and they can easily be assigned a tab completion shortcut Only one character.Ĭheck out Emmet's cheat sheet for more little bits. Which is pretty much what you were looking for! And if you want to take it another step further, Emmet also supports expanding ! which is an alias for html:5.



However Emmet is quite clever and we can go one step further.

Will compile to the above (with a trailing closing tag of which is a bit awkward. For example, the following string: !doctype>html>(head>title)+(body) Essentially, you type out "CSS like" strings, put your caret at the end of the string and hit tab and Emmet will parse it into HTML. The feature that you specifically want in Emmet is called " Expand Abbreviation". However, there is another workflow that you are able to use using a toolkit such as Emmet. Perhaps you should look into templates for your IDE, for example in Sublime Text you have snippets which I would recommend looking into.
