Sublime Setup for Mamp open in browser

After a while got really in love with the Sublime text 2 , but one thing never got working even after installing several packages from Git Hub to open files in the Browser on a local MAMP Server. Several solution and extensions are available for Sublime text 2 but most explain how to setup open in browser for windows and feine keys if you have you APPs on a default location. Sublime is a hyperfast and stable  cross platform Text and Code editor for all who loved Notepad ++ will like even more Sublime Text 2 .

After all html php files open on the wrong path the solution with file replace worked best as my application folder are on a different hard drive . Based on these tutorial fromFluidWebStudio . That would work if you have your apps in default location , in my case it fires up firefox for windows or cant find the right path for the browser and the local files. 

Default Open in Browser 

{
"cmd": ["open" , "-a" , "Chrome" , "http://localhost:8888/${file}"]
}

MAMP  on localhost:8888

web projekts are on the hard drive: /www

Applications on hard drive: Volume/Meta 

Open in Browser with key short cut : ALT + CMD + B

All Files opend up on localhost:8888/Volumes/www/dev/myfiles.php  instead of

localhost:8888/dev/myfiles.php  with the  Suggestion from Sublime forum  julamb helped me finaly to get it run as it should. Simply search and replace the part you dont need in the path. Start with a smal partial replace and extend it shortly to prevent syntax errors. 

 ${ file/ search / replace /}

 each /  need to be escaped with \\.

Build for Google Chrome 

{
"cmd": ["open" , "-a" , "/Volumes/Meta/Applications/Google Chrome.app" , "http://localhost:8888/${file/\\/Volumes\\/www\\///}"]
}

Build for Safari 

{

"cmd": ["open" , "-a" , "/Volumes/Meta/Applications/Safari.app" , "http://localhost:8888/${file/\\/Volumes\\/www\\///}"]

}

Build for Firefox 

{
"cmd": ["open" , "-a" , "/Volumes/Meta/Applications/Firefox.app" , "http://localhost:8888/${file/\\/Volumes\\/www\\///}"]
}

 Some more must  have Sublime Extensions 

Sublime SideBar Extension  ( for some reason dont run right away but after deactivating and reactivating the package it runs )

LiveReload Browser extension to auto reload Sublime pages

Spectaclefast move your windows into right place  ,Move and resize your windows with ease short cuts 

More great video tutorial how to work with Submlime that beats Coda and Espresso from Russia @andreyvit

 

 

SAY HELLO

avatar
  Subscribe  
Notify of