6

I got the plugin view in browser . because I didn't know how to view my html stuff in a browser via key strokes only and I did research on this site and you guys recommended using the plugin.

I think I followed the instructions carefully. I went to package control and installed the package. I see the view in browser folder in the package folder. but when I press alt + ctrl +v it just says that the document is saved. and the browser doesn't open. I would like it to open.

Please help me get the file open in the browser with just key strokes using sublime text 2. I have windows 7

4

7 に答える 7

6

The plugin defaults to Firefox, which doesn't seem to work on Windows (I can't get it to open either, probably because the command is just firefox which is not in the PATH). To get it to open with Chrome, edit View In Browser.sublime-settings in the folder of the package. Change selectedBrowser to chrome and change the command filepath to where chrome is on your computer (probably just change the user name).

Alternatively, try pressing F12, which opens the current file in browser for me, but I'm not sure if it's from a plugin I've installed or not. I found this by pressing ctrl+shift+p and typing in "Browser". Searching like this often a good way to find functionality you suspect exists, but don't know what the exact command/shortcut is.

于 2013-02-06T01:19:08.873 に答える
4

I am running Windows 8, so I opened View In Browser.sublime-settings and changed the command in chrome by typing the whole path and selected-Browser to chrome, and it worked for me. Here are my settings:

"command": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
"selectedBrowser": "chrome"

Now when I click ctrl+alt+v the page opens in Chrome.

于 2013-02-24T16:52:30.343 に答える
2

Once you have installed the "view in browser", press "ctrl+shift+p", search "preferences:Browse Packages". This will open a folder "Packages". In this folder go to View In Browser> View In Browser (a SUBLIME-SETTINGS File). Here make 2 changes:

Line 33: "browser": "firefox"

change it to

Line 33: "browser": "chrome"

and

Line 27: "chrome": "%Local AppData%\\Google\\Chrome\\Application\\chrome.exe",

change it to

Line 27: "chrome": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",

Basically you changed your default browser in which your file is opened to chrome and then you corrected that path of chrome for windows to where your chrome is located because for some reason local app data didn't give the right path.

Let me know if there is still a problem.

P.S: BEEN_THERE_DONE_THAT

于 2015-07-30T18:13:10.383 に答える
2

I didn't know even the first step so I'll post my solution for Chrome & Windows 10.

When you edit your settings it needs to be made as a JSON. The easiest thing to do is open the default settings first: Preferences -> View in Browser -> Default.

Copy that and then open Preferences -> View in Browser -> User. Paste. Then edit the line:

"browser":"firefox" to "browser": "chrome64"

Save and it works!

于 2016-02-13T19:50:56.923 に答える
0

I am running WinXP, I had the same problem, but when I removed the "(x86)" from the address in the "command" as mentioned in the View In the Browser.sublime-settings, it worked. Hope this works for you.

So it would look like this in the sublime-settings file:

"command": "C:/Program Files/Mozilla Firefox/firefox.exe"

Try it out. If someone knows why this happens, please do let us know.

于 2013-07-15T15:10:09.890 に答える
0

The default settings for the plugin don't work for every computer out of the box. At the bottom of View In Browser.sublime-settings, there is a line that says "selectedBrowser": "Chrome". It may say Firefox by default. Leave it if you use Firefox, or set it to Chrome, or whatever.

After you've done that, go further up in the config file until you see the name of the browser that you want to use. Make sure the path for your operating system points to the correct place. Then everything should work just fine.

于 2013-08-06T20:06:37.633 に答える
0

I came through same problem and unfortunately could not able to figure out. But SideBarEnhancements pretty much same with many added useful features.

titoBouzout/SideBarEnhancements

于 2014-08-07T17:40:43.723 に答える