Go to “Tools -> Build System -> New Build System…” and paste this:
{
"shell_cmd": "firefox '$file'",
"selector": "text.html"
}
Now whenever you call “Build” on a file that is defined as an HTML document the file will open on Firefox.
The above will open the file as if you had double-clicked the HTML file, if you already have a local server running and you create a project in Sublime you can change to this:
{
"shell_cmd": "firefox 'http://$project_base_name/$file_name'",
"selector": "text.html"
}
In the above if your project file is called mySite.sublime-project and the file is home.html, Firefox will try to load http://mySite/home.html
If you want to create build systems to other files, like PHP, and want to know what you should put in selector, create a new file, set syntax to the file you wish to create a build system and press Ctrl+Alt+Shift+P, the text that shows in the box is what you need. For PHP that would be embedding.php
.
More info on the build system can be found in the documentation manual.