Sublime Forum

Problems with View in Browser ( solved )

#1

Hello there,

first of all let me say that Sublime Text 2 is very cool stuff…
But: how difficult can it be, to view a page in a Browser as a WebSite, not as a FILE? Im working with an iMac, my favorite Browser is chrome. I´m using PHP and MySQL on localhost with XAMPP!

I´ve tried the following things:

  • PlugIn: SideBarEnhancements ( my Favorite )

  • BuiltInBrowsers

  • Plugin: View in Browser

Nothing is going to work correctly. The following snippet is from “Perfect Workflow in Sublime Text 2” from “Jeffrey Way” - but it doesn´t work.

	"url" : "http://localhost",
	"folders":
	
		{
			"path": "/Applications/XAMPP/xamppfiles/htdocs/blabla"
		}
	]
}

So, what is the problem? Did anyone know?
Thanks for helping

0 Likes

#2

Hi folks,

the problem is solved. I think, the tutorial from “Jeffrey Way” belongs to an older version or whatever. I solved the problem in this way:

  1. install Package “SideBarEnhancements”
  2. right-click on a file within your project -> choose -> “PROJECT - EDIT PROJECT PREVIEW URLs”
  3. enter this code ( choose your folders… )
{
    "/Applications/XAMPP/xamppfiles/htdocs/myWebSite":{
        "url_testing":"http://localhost/myWebSite"
    }
}
  1. Choose from the Sublime-Menu PREFERENCES - BROWSE PACKAGES.
  2. Go to folder “SideBarEnhancements” and open the file “Default(OSX).sublime-keymap”
  3. Change the ShortCut in any way you want and be aware of “type” is “testing” or “production”, depending on your entry above.

	{ "keys": "f12"],
		"command": "side_bar_open_in_browser" ,
               "args":{"paths":], "type":"production"}
        },
	{ "keys": "super+0"],
		"command": "side_bar_open_in_browser",
		"args":{"paths":], "type":"testing"}
	},
]

That´s it.

0 Likes

#3

xMen…
wow, you wont even imagine how many gray hair i have got whilst trying to find a solution for this…and finally, after i followed your instructions it has worked!!! Thanks thanks again, as i love to death sublime text2, but that(unable to launch .php ext files in the browser) was driving me crazy :imp: someone should create a simple tutorial for this, since there are nothing in regards this topic. Video or some kind of simple to understand manual would be great for the community!!!

Thanks

0 Likes

#4

MJ-8,

believe me, I can imagine how many gray hairs you´ve got!!!

I think for those people, who record tuts every day with a tool, it is very simple to make a tutorial. But I never did before. So community, let´s make it…

0 Likes

#5

What’s so difficult to understand of this page github.com/titoBouzout/SideBarE … ts#f12-key

0 Likes

#6

There is nothing difficult. This pages has solved my problem :sunglasses:

0 Likes

#7

xMen, you are right…u got the problem solved :wink: thanks

0 Likes

#8

Worked for me. Big thank you for helping this Apple newbie :smiley:

0 Likes

#9

[quote=“xMen”]Hi folks,

the problem is solved. I think, the tutorial from “Jeffrey Way” belongs to an older version or whatever. I solved the problem in this way:

  1. install Package “SideBarEnhancements”
  2. right-click on a file within your project -> choose -> “PROJECT - EDIT PROJECT PREVIEW URLs”
  3. enter this code ( choose your folders… )
{
    "/Applications/XAMPP/xamppfiles/htdocs/myWebSite":{
        "url_testing":"http://localhost/myWebSite"
    }
}
  1. Choose from the Sublime-Menu PREFERENCES - BROWSE PACKAGES.
  2. Go to folder “SideBarEnhancements” and open the file “Default(OSX).sublime-keymap”
  3. Change the ShortCut in any way you want and be aware of “type” is “testing” or “production”, depending on your entry above.

	{ "keys": "f12"],
		"command": "side_bar_open_in_browser" ,
               "args":{"paths":], "type":"production"}
        },
	{ "keys": "super+0"],
		"command": "side_bar_open_in_browser",
		"args":{"paths":], "type":"testing"}
	},
]

That´s it.[/quote]

This part does not work for me -> 2. right-click on a file within your project -> choose -> “PROJECT - EDIT PROJECT PREVIEW URLs”

Am supposed to right click on a file in the sidebar ? If thats so, i dont get the option project -> choose ->. Please someone explain this to me ? :smile:

I also get the bare code when when i want to view in browser.

0 Likes

#10
  1. install Package “SideBarEnhancements”
  2. Drop a folder to the editor, or to the sidebar.
  3. There should be a menuitem called project in the files context menu. IF you only see “close”, then you are clicking “open files” section, not “folder section”.
0 Likes

#11

okay, i installed SideBarEnhancements properly and i can now go to that said file, edited the file PROJECT PREVIEW URLs like so : { "/Applications/XAMPP/xamppfiles/htdocs/phpproject12":{ "url_testing":"http://localhost/phpproject12" } } Phpproject12 is the folder where i have my index file in, but this is still linking me wrong, browser shows “file:///C:/xampp/htdocs/PhpProject12/index.php” which shows the code. what am i doing wrong ? :frowning:
This is the only thing missing before im set with sublime and can finally leave netbeans. I didnt do edit Default(OSX).sublime-keymap since i dont want to alter any shortcuts.
Btw, i already had installed “view browser” plugin before this sidebarenhacement thing, is that maybe causing a problem ? Im on windows 7 if that matters.

[quote=“tito”]1. install Package “SideBarEnhancements”
2. Drop a folder to the editor, or to the sidebar.
3. There should be a menuitem called project in the files context menu. IF you only see “close”, then you are clicking “open files” section, not “folder section”.[/quote]

0 Likes

#12

{ "C:/xampp/htdocs/":{ "url_testing":"http://localhost/" } }

0 Likes

#13

SideBarEnhancements How and where can I change the default browser

0 Likes