Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Getting Sublime 3 To Launch your HTML page in a Browser with a Key Combo

DZone's Guide to

Getting Sublime 3 To Launch your HTML page in a Browser with a Key Combo

· Web Dev Zone ·
Free Resource

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

Introduction

I recently installed Sublime 3 Beta and created an .HTML file and wanted to launch it in Chrome from within the IDE without right-clicking the file and selecting “Open From Browser”. I wanted to simply hit a key combo. I looked through all of the options and could not find a way. I discovered that you could add a new build system though and get this functionality.

pic1

Steps

  • Tools -> Build System -> New Build System...
  • Add the following Text for opening with Google Chrome
{
    "cmd": ["open", "-a", "Google Chrome", "$file"]
}

pic2

  • You screen should look like what is shown above.
  • Save the file as : Chrome.sublime-build in your “User Folder”

pic3

Now select Tools –> Build System –> chrome and switch back to the HTML file and hit CMD-B on a Mac.

 pic4

You can optionally change this to open with your default browser by using { "cmd": ["open", "$file"] }

What about Windows?

For Windows Machines, following the same instructions except use the command : { "cmd": ["PATH_TO_YOUR_CHROME", "$file"] }

You can run it by pressing CTRL-B.

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}