Ivan Petrov
Ivan Petrov

Reputation: 11

How to change the default markup in Sublime Text 3?

When I write <htm and press on the promtp by Enter, Sublime Text gives hypertext markup such as:

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

</body>
</html>

How I can to change this code, i.e. add some tags and spaces?

Upvotes: 1

Views: 272

Answers (1)

MattDMo
MattDMo

Reputation: 102862

This is triggered by a snippet in the HTML package. To edit it, you'll first need to install PackageResourceViewer from Package Control. Then, open the Command Palette and type in prv to bring up the PackageResourceViewer options. Select PackageResourceViewer: Open Resource → HTML → Snippets → html.sublime-snippet to open the snippet. Edit the snippet as you wish (see the link above for options), then hit save. The file will be saved as Packages/HTML/Snippets/html.sublime-snippet, where the Packages directory is the one opened when selecting Preferences → Browse Packages…:

  • Linux: ~/.config/sublime-text-3/Packages
  • OS X: ~/Library/Application Support/Sublime Text 3/Packages
  • Windows Regular Install: C:\Users\YourUserName\AppData\Roaming\Sublime Text 3\Packages
  • Windows Portable Install: InstallationFolder\Sublime Text 3\Data\Packages

Keep in mind that this file will always override the identically-named file in the HTML.sublime-package archive. This means that your saved file will not be upgraded when you upgrade Sublime Text.

Upvotes: 1

Related Questions