Sublime Forum

Preview HTML page in ST2? Or launch HTML page in browser?

#1

I can’t find any option to launch an HTML into Chrome or FF or any browser, does Sublime even have that feature? Or at least is there a plugin for it? I would love to see a preview panel within Sublime2, that would be beneficial.

Update: i’ve been trying to figure this out, this is what I did:

Created a new plugin with this code to open the HTML page in Google Chrome:

[code]import sublime, sublime_plugin
import subprocess

class OpenBrowserCommand(sublime_plugin.TextCommand):
def run(self,edit):
subprocess.call([r’C:\Users\Nicholas\AppData\Local\Google\Chrome\Application\chrome.exe’, ‘-new-tab’, self.view.file_name()])[/code]

Then in the “key bindings - user” file I have this:

{ "keys": "ctrl+f9"], "command": "Open_Browser" } ]

It’s not working though, what am I doing wrong? I really don’t know what I’m doing, I managed to piece this together from other topics around this Forum.

0 Likes

#2

Also try C:\Users\Nicholas\AppData\Local\Google\Chrome\Application\chrome.exe

0 Likes