Home Download Buy Blog Forum Support

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

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

Postby nicktheandroid on Sun Oct 23, 2011 12:21 am

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: Select all
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()])


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

Code: Select all
[
{ "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.
nicktheandroid
 
Posts: 16
Joined: Tue Feb 08, 2011 5:33 pm

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

Postby firefusion on Mon Oct 24, 2011 12:59 am

Also try C:\\Users\\Nicholas\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe
firefusion
 
Posts: 218
Joined: Fri Oct 16, 2009 7:37 am


Return to General Discussion

Who is online

Users browsing this forum: gmm and 19 guests