Sublime text build system html for mac
- #Sublime text build system html for mac how to#
- #Sublime text build system html for mac full#
- #Sublime text build system html for mac code#
#Sublime text build system html for mac code#
I wanted to browse HTML code without a web server on a Mac. I found a quick and easy way to solve this with some built in OS features on the Mac. For example, to avoid getting Cross Origin request errors when using AngularJS and routing for templates.
Simple HTML/JS is fine off the file system, but somethings require a bit more. So why did I go down this road? Well, when writing and testing some SPA code I often want to run it in the context of a web server. Overall I love the plug in model, but its very similar to Visual Studio’s in that you need to try them out to know which you like. But many of the plug-ins lack polish, some don’t seem to work well, and it can be daunting to know which one to choose at times. Sublime is pretty cool as an editor and the plug-in ecosystem is reach.
When I want to write and test some quick HTML/JavaScript/CSS that requires a web server on the Mac Air I use Sublime Text. The combination of the Mac Air’s sleek and lightweight design along with the super long life and power of the Haswell chip is just fantastic! I’m using both OSX and Windows (in Parallels) and I spend most of my time on the Air in Xcode, Sublime Text, and Visual Studio (also tinkering with AppCode from Jet Brains ... but more on that later). Just open any HTML file or write and save a new file as HTML and press "CTRL+B" or go to "Tools" > "Build" and it will open the HTML file in Google Chrome.Lately one of the computers I have been using is a Mac Air with the Haswell chip. Now since you have saved the build system as "Chrome.sublime-build" in the Build Systems directory, it will now show up in "Build System", select it: If you see any other folder then please ensure and change it to the folder above otherwise Sublime Text will not be able to see and use this build system.Īnd yes, don't forget to escape the backslash in the path! (highlighted in violet in the following picture):ĥ. "C:\Users\YourUserName\AppData\Roaming\Sublime Text 3\Packages\User" Modify the contents of the new sublime build file as below and save as "Chrome.sublime-build".īy default it shows the build directory that should be: "YourUserName" is your user account name under which you're working in Windows 7.Ĥ. "C:\Users\YourUserName\AppData\Local\Google\Chrome\Application\chrome.exe"
#Sublime text build system html for mac full#
Find "Google Chrome" in your Programs then right-click on "Properties" then select "Copy the full path of the application", it will look like this: It will open a file named "untitled.sublime-build" as in the following picture:ģ. Start "Sublime Text" then from "Tools" select "Build System" > "New Build System." as in the following:Ģ. Note: I'm using Sublime Text 3 and running Windows 7.ġ.
To get to the actual point of this article, to create a build system to run your HTML file in Google Chrome on build: use the following procedure. It allows you to run external programs from within the editor.Īs per the Sublime Text Unofficial Documentation: "Build systems let you run your files through external programs, like make, tidy, interpreters and so on." Build Systems are JSON files with the extension ".sublime-build". You first need to create a "Build System" called by Sublime Text to do it.
#Sublime text build system html for mac how to#
Here I'm sharing the procedure for how to make it work. I often use Sublime Text as my GoTo text editing tool for not so serious scripting and when I want to open HTML files in Google Chrome on a build.