Sublime Text 2 Build System Chrome For Mac

  1. Sublime Text New Build System
  2. Sublime Text 3 Build
  3. Install Sublime Text 2

Prolog syntax highlighting for Sublime Text 2 & 3. This package provides syntax highlighting and automated build for the logic programming language Prolog. It is highly work in progress, so use with care. Auto Build System. To be able to use the Ctrl+B automatic build, you need to define main/0 where you compute the solution and you also print. Launch Sublime Text 2 or 3 from the Mac OSX Terminal As I’m working in the OSX Terminal more and more these days, I'm always on the lookout for time-saving shortcuts. A really useful tip that I picked up recently from Zander Martineau is how to open up Sublime Text straight from the Terminal. Even though the (non-existing) output of Sublime's console indicates that the build system isn't configured to correctly work with Node.js, I got some Node.js errors displayed when I accidentally tried to run non-JS files such as the Node.sublime-build file. This is the output displayed in Sublime's console.

Answers

  • Have you read the Getting started tutorial? :(|)

    You'll see that in principle you don't need anything extra to author p5js sketches in Sublime Text (or any other text editor); except a browser to open your files. There is no required compile step to run JS code!!!

    It is however a good idea to run a local server to test with; since you can run into security restrictions when trying to dynamically load local assets.

  • edited April 2016

    It is however a good idea to run a local server to test with; ...

    I dunno why folks don't state the obvious: Any Firefox based browser can freely run any JS scripts!
    And for Chrome based 1s, like SlimJet for example, just add '--allow-file-access-from-files' in its shortcut. Here's how mine is: 'C:Program FilesSlimjetslimjet.exe' --allow-file-access-from-files

  • edited April 2016

    There's also an online IDE dedicated to p5.js: http://p5ide.HerokuApp.com/editor
    For hosting as well, I like this 1: http://p5js.SketchPad.cc

  • edited April 2016

    Here's some sketch entirely embedded in 1 '.html' file.
    It works in any up-to-date Chrome, Firefox and even IE11 based browsers.
    In IE11, just click to accept to run 'blocked content' though. B-)

    It's available online in these 2 sketch hosting sites:

    Also running under Pjs library (Java/JS cross-mode): :>http://studio.ProcessingTogether.com/sp/pad/export/ro.9lMOG-RZX8JDk

    Just copy and paste the code below, saving it as an '.html' file.
    Then double-click or drag it to some browser: :-bd

  • Also you can create the following Build System file in {Path to Sublime Text folder}/Packages/User folder, choose new build system from Tools->Build System menu and run your scripts directly from the text editor with Ctrl+B command.

As I’m working in the OSX Terminal more and more these days, I'm always on the lookout for time-saving shortcuts.

A really useful tip that I picked up recently from Zander Martineau is how to open up Sublime Text straight from the Terminal. This is done by hooking into a CLI utility that Sublime provides called subl.

Sublime text no build system

The following instructions are based largely on the original gist on Github by Artero, so credit for this solution should be directed to them and not myself.

It’s a slightly different installation depending on whether you’re using Sublime Text 2 or 3, so I’ll split the two out below in the installaton; simply refer to the instructions that are relevant to you.

Installation

Assuming you installed Sublime in the Applications folder, the following command should open up the editor when you type it into the Terminal:

For Sublime Text 2:

New

open /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl

For Sublime Text 3:

open /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl

If that worked, you're good to go.

You now need to create a symlink called sublime which links the subl CLI to a folder where your system usually looks to execute these binaries. To do this, type in:

For Sublime Text 2:

ln -s /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

For Sublime Text 3:

ln -s '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl' /usr/local/bin/sublime

Check your profile

The final thing you need to do, is to check that your system profile is looking in the right place to see the symlink you have just created.

Enter the following command into your Terminal:

open ~/.bash_profile

Note that in some cases the profile may be called ~/.profile.

This should open up your profile in a text editor. What you’re looking for is a line towards the top of the file that starts with export PATH=. Your PATH contains all the directories that will be checked for executable binaries when you type a command into your Terminal. Since we created a symlink in the /usr/local/bin folder, we want to make sure that that folder is being checked too.

Hopefully, you’ll be able to see something similar to this:

export PATH=/usr/local/bin:(...)

If not, simply add this folder to your PATH and save the file.

Note: The (...) in this example represents other folders that would be listed on the same line and separated by a colon.

If you don't already have a PATH set in your bash_profile you can type the following on a new line:

export PATH=/usr/local/bin:$PATH

Finally, if you did have to add /usr/local/bin to your PATH, run the following command before continuing:

Sublime Text 2 Build System Chrome For Mac

source ~/.bash_profile

Sublime Text New Build System

This will reload your .bash_profile with the newly added directory in your PATH.

SublimeSublime text no build system

Test it works!

In your Terminal, the following commands should now work:

Sublime Text 3 Build

  • sublime . – opens the current directory in Sublime
  • sublime filename – opens a file where filename is the file to be opened
  • sublime foldername – opens a folder where foldername is the folder to be opened

And there you have it – you can now open any file or folder in Sublime straight from the Terminal.

Install Sublime Text 2

Thanks and credit for this great solution again goes to Artero. If you have any problems getting it working, let me know and I’ll do my best to help you out.

This is archived from Ashley Nolan's blog, so it can be accessed if/when that site goes down.