146

I just started using Sublime Text 2 on Mac. I also just started using Jade for my views in Node.js, and am wondering if there is a way to add syntax highlighting for Jade into Sublime Text 2.

ragnarswanson
  • 315
  • 3
  • 10
James Simpson
  • 13,488
  • 26
  • 83
  • 108

9 Answers9

179

If you have git installed, this worked perfectly for me:

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone https://github.com/davidrios/jade-tmbundle Jade

Bonus to get stylus syntax highlighting working run:

git clone https://github.com/stylus/stylus.git Stylus
bytesized
  • 1,502
  • 13
  • 22
SavoryBytes
  • 35,571
  • 4
  • 52
  • 61
  • 20
    just the 'follow these steps' response i was looking for. – emilebaizel Feb 07 '12 at 19:26
  • 3
    @jurka For Ubuntu: ~/.config/sublime-text-2/Packages – Mustafa Jun 29 '12 at 15:04
  • 1
    This worked for me on Mountain Lion. Make sure you reboot Sublime after installing this to see the syntax highlighting. – Matt Kneiser Nov 21 '12 at 00:31
  • 2
    For Windows (7 at least) use: /c/Users//AppData/Roaming/Sublime Text 2/Packages – longda Aug 16 '13 at 19:06
  • **+1** *(Just to clarify)* Works on **Linux Mint Maya MATE AMD64** – iConnor Nov 02 '13 at 07:52
  • 3
    THE AUTHOR HAS NOT MAINTAINED THIS REPO! A more recent repo is at https://github.com/davidrios/jade-tmbundle – jnovack Jan 10 '14 at 14:12
  • I initially thought that this did not work, but then discovered that Sublime had not automatically set the correct syntax for Jade files that were already open before I restarted Sublime. Simple matter to set the syntax or even just reopen the Jade file once I realized this. – bytesized Jul 06 '15 at 16:34
155

Sublime Text 2 supports Textmate syntax definition files. There is a Jade Textmate bundle at https://github.com/miksago/jade-tmbundle.

Install by creating a new folder in your Sublime Text "Packages" folder, call the new folder Jade, then curl -O https://raw.github.com/miksago/jade-tmbundle/master/Syntaxes/Jade.tmLanguage or otherwise download that file into the new folder. The editor will load the syntax immediately.

RAYash
  • 30
  • 4
Rob Cowie
  • 22,259
  • 6
  • 62
  • 56
  • 12
    Thanks. Just for those who did not know it (me, for example), the packages folder on Linux is ~/.config/sublime-text-2/Packages – Elad Aug 29 '12 at 10:49
  • 29
    Worked like a charm! On OS X Lion it's ~/Library/Application Support/Sublime Text 2/Packages/ – michael_erasmus Sep 02 '12 at 11:47
  • 16
    Windows: C:\Users\\AppData\Roaming\Sublime Text 2\Packages. Or on any platform just go to Preferences > Browse Packages in the editor to find the directory. – Fletch Oct 15 '12 at 10:37
  • +1 Worked great in Mountain Lion. Didn't even have to reload or restart Sublime. Might this replace Textmate for me? lol – cbmeeks Jan 26 '13 at 22:10
  • 1
    This worked for me too! But I had to restart Sublime. – Maria Ines Parnisari Jan 17 '16 at 21:51
74

Why yes, there is! And it uses a nice packaging system too:

  1. If you need to, install Package Control from here
  2. Open the command palette (command + shift + P) and go to Package Control (just type "install"). You may need to wait for the repository to be updated.
  3. When in package control type "jade" to find the Jade Syntax Highlighting package. Hit enter to install it.

You now have syntax highlighting for Jade and a nifty package controller for other Sublime goodies. This search shows a lot of available tools for working with Jade, Jade+Bootstrap, pyjade, etc

Edit - Sublime doesn't need to be restarted after installing this package so this step was removed.

Hamy
  • 20,662
  • 15
  • 74
  • 102
Simon
  • 1,756
  • 12
  • 8
  • 2
    Best answer! :) I didn't even restart as it was immediately available. I just picked the syntax from the list for already opened files. The new highlighter was already associated with .jade files. – WiredPrairie Jul 11 '12 at 13:49
  • Yeah, Package Control is amazing. It's only (very minor) flaw is that you can't use it for /everything/, as sometimes (rarely) language packs etc. don't get included in its list. – iono Aug 16 '12 at 17:27
  • 8
    I do not see the Jade syntax highlighting package in the list - maybe it is no longer available? There is a Textmate/Sublime bundle from davidrios. – SnapShot Apr 06 '13 at 12:04
  • @SnapShot The bundle from davidrios will give you syntax highlighting. – wuno Jul 18 '14 at 14:51
10

@jurka -

  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/
  • Linux: ~/.Sublime Text 2/Packages/
  • Windows: %APPDATA%/Sublime Text 2/Packages/

Clone into the path shown above for linux.

Vincent Mac
  • 421
  • 4
  • 8
5

Jade is also available via the Sublime Package Control.

cschol
  • 12,799
  • 11
  • 66
  • 80
2

For ubuntu 11.10 correct path to packages for me is ~/.config/sublime-text-2/Packages You can easily find your packages location using Menu: "Preferences" -> "Browse Packages..."

Eugene
  • 21
  • 1
2

The accepted answer refers to a plugin that is deprecated and no longer active. For those who are still looking for a supported Jade plugin for Sublime Text, you should use this repo:

https://github.com/davidrios/jade-tmbundle

This is also on Package Control:

https://packagecontrol.io/packages/Jade

Josh Hardy
  • 361
  • 2
  • 4
1

If you are on Mac:

Go to Library/Applciation Support/Sublime Text 2/Packages/ then,

curl -O https://raw.github.com/miksago/jade-tmbundle/master/Syntaxes/Jade.tmLanguage
1

I've made the following on linux ST2 build 2221:

git clone https://github.com/miksago/jade-tmbundle.git Jade.tmbundle

Then

zip -r Jade.zip Jade.tmbundle/
mv Jade.zip Jade.sublime-package
mv Jade.sublime-package /sublime_folder_location/Pristine Packages/
brrystrw
  • 471
  • 7
  • 20