A quick hack on Sublime text when working on Macs is to get the editor to invoke the 'open' command so that you can hit command+B to 'open' the file in your favorite app. My favorite use for it is when editing html files, i want it to open in my favorite browser.
On a Mac, 'open' is the equivalent of the default file association in Windows, such as when you click on a text file, you can have it open in your favorite editor.
In sublime, go to Tools > Build System
Select New build system
In the file that opens type this in into the pre-filled section and save the file with a name you want, such as 'open.sublime-build':
{
"cmd": ["open", "$file"]
}
Then go back to the file you were editing, Tools > Build System. Now select your newly saved build system. Now every time you hit command + B you get the file to open on Chrome (which is what my Mac is setup by default to open html files with)!
Obviously, there is nothing MAc specific with this approach, you can do this with anything. You can setup a build system to run python files for example, by replacing "open" with "python"
Love this editor!
Comments
Post a Comment