Sublime Forum

Preview in browser

#1

https://github.com/wattsin/Sublime-Text—Open-And-View

I created this simple plugin for myself, but I think others might find it useful.

Upon execution it will scan the top 10 lines of the current file for an identifier. I have it setup something like this:

//LOCATION: /controllerName/

It will scan the top for “//LOCATION:”. Once it finds this it will grab the /controllerName/ and append it to the URL defined in the plugin.

So in my case it will open up my browser and go to localhost:8888/controllerName/

The reason I’ve added the location tag to the top of every page is because when your using frameworks or ajax type applications. The file doesn’t necessary relate directly to the page it’s supposed to be viewed on.

I’ve only been using Sublime Text for a few days now, it’s really awesome so far…

This is also the first thing I’ve wrote in Python, so don’t hate.

Hope this helps someone

Happy New Year,
Derek

0 Likes