Mac OSX: Run Sublime from your terminal

Posted on in Environment Sublime Text

Wouldn't it be cool to navigate within your terminal to your project folder and then run sublime with the following command:

subl . 

It's easy to setup...

Add the bin folder to your paths:
First open your ~/.bash_profile file. (it's hidden so you will need to enable hidden folders.)
Add the following line:

export PATH=~/bin:$PATH

Create a symlink

sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

Please note the first path, is the path to your Sublime Text 2 app. If you moved your app to a different folder you will need to modify this line.
The second path is the place where you will create your symlink. This is the ~/bin folder.
Since you've added the bin folder to your classpaths; you can now easily run the subl . commands.

Mac OSX: How to install JSHint to the commandline / Sublime Text with Node

Posted on in Environment Sublime Text

Install Node:
http://nodejs.org/download/
Download the Mac OS X package, and install it. Test by opening up a Terminal and typing "node -v". It should say something like "v0.8.11" or higher.

Install NPM (package manager)
https://npmjs.org/

curl http://npmjs.org/install.sh | sh

Install JSHint via NPM

sudo npm -g install jshint

To have JSHint installed in Sublime, use the package control and install the following packages:

http://wbond.net/sublime_packages/package_control/installation

CTRL/CMD + SHIFT + P > Package Control : Install Packages > Sublime JSHINT
https://github.com/uipoet/sublime-jshint
CTRL/CMD + SHIFT + P > Package Control : Install Packages > SublimeLinter
https://github.com/SublimeLinter/SublimeLinter
CTRL/CMD + SHIFT + P > Package Control : Install Packages > Sublime On Save Build
https://github.com/alexnj/SublimeOnSaveBuild
CTRL/CMD + SHIFT + P > Package Control: Install Packages > Detect Syntax
https://github.com/phillipkoebbe/DetectSyntax