This is all a test

Problem Solved

May 9, 2015 by Corey


I was stuck on this little thing in Sublime for hours; it was one of those leave the computer for awhile and let the problem marinate.  This was particularly frustrating because prior to my system restore, I had this working in a google search and some copy pasta work.

SO in case I forget again, I’m putting this here. Now on to the next crisis…

Problem: How do I open a file I’m working on through my local host server?
Solution: First of all you’ll need to install the Sublime plugin “SidebarEnhancements“.  Then just right click any file of folder in the sidebar, and select -> “Project” -> “Edit Preview URLs” Copy pasta something like this into the blank file that opens:

{
     "/Path/to/your/www":{
     "url_testing":"http://localhost",
     "url_production":"http://localhost"
     },
     "/Users/luna/some/other/project":{
     "url_testing":"http://localhost",
     "url_production":"http://localhost"
     }
}

This is what I used:

{
     "C:/wamp/www":{
          "url_testing":"http://localhost/"
     }
}

I don’t speak JSON but it seems simple enough.  The point is to have your root folder (or any folder I assume) point to where the index.php file lives.  Then after you hit your preset (F12 by default but Sublime 3 changed a few things) hot key, sublime will open whatever you’re working on through the server and not your file hierarchy.

 

The gif above is from the netflix tv show Unbreakable Kimmy Schmidt, which I find hilarious.  Is netflix still tv if I watch it on my tablet?  Unsolvable questions.

Conversation

Your email address will not be published. Required fields are marked *

*