Reputation: 1872
When I'm editing an html file in Sublime Text 2, I'd like to open it in Chrome to view it. Ideally, I'd perform a keyboard shortcut to do this.
I've created a custom 'Chrome' build file for this and it opens the file in Chrome upon each save of the file. This is fine, but the problem is that it opens the files at the url of:
file://localhost/Users/scott/Sites/my-new-site/video.html
I'd rather it opens a file at:
http://localhost/~scott/my-new-site/video.html
i.e. i'd like to have it know where the file is, replace:
replace('file://localhost/Users/scott/Sites/')
with 'http://localhost/~scott'
and open Chrome at that newly assembled url
Does anyone know how to do this? is this a customization to my build file? or is this another plugin that someone knows about?
I did try https://github.com/adampresley/sublime-view-in-browser ST2 plugin. And while it DOES work, I'd have to edit the project configs for each project I want to open in this way. This is a bit of a pain as I don't necessarily edit all of my projects in ST2. I'd rather there were a centralized way that I can assume the the files I open are relative to my local server's DocumentRoot... which /Users/scott/Sites is.
Thanks, Scott
Upvotes: 0
Views: 1730
Reputation: 9890
Paste below code according to your path
{ "D:\Web\localhost\tanxerina":{ "url_testing":"http://localhost/tanxerina.com", "url_production":"http://www.tanxerina.com" } }
Upvotes: 0