11

I want to install the ES6 language syntax highlighting at https://github.com/Benvie/JavaScriptNext.tmLanguage for TextMate 2. I cloned the repo, but it has a .tmLanguage directory with multiple files (.tmTheme, .tmLanguage, etc.).

Apparently, TM2 only supports everything inside a .tmBundle. Is there any clean way to just install the language support?

deitch
  • 14,019
  • 14
  • 68
  • 96

2 Answers2

15

I just ran into this as well. There's a (closed, unfortunately) pull request that makes possible what you and I wanted. To get it working, I used dhensche's fork and performed the following:

  1. Quit TextMate 2

  2. Run the following:

    git clone git@github.com:dhensche/JavaScriptNext.tmLanguage.git
    cd JavaScriptNext.tmLanguage
    ./create-bundle.sh
    cp -R JavaScriptNext.tmbundle ~/Library/Application\ Support/Avian/Pristine\ Copy/Bundles/
    
  3. Re-launch TextMate 2, open an ES6 file, and select "JavaScript Next" from the toolbar along the bottom of the editor.

Hopefully Benvie will integrate proper TextMate 2 support in the build process soon, since it's not far off, as dhensche demonstrated.

Collin Allen
  • 4,449
  • 3
  • 37
  • 52
  • That worked! Is there any way to get it to automatically recognize `.es6` extension files? (yes, I know, really should be `.js` but conflicts). And why does it not show up in the bundle editor? – deitch May 22 '15 at 06:18
  • Hmm, it shows up in the Bundle Editor for me, where I can edit file types. – Collin Allen May 29 '15 at 20:14
  • You are right, it works. I just had to adjust the recognized files. – deitch May 30 '15 at 17:36
  • 3
    I received a bunch of errors `No such file or directory`. I had to `cp -R JavaScriptNext.tmbundle ~/Library/Application\ Support/TextMate/Managed/Bundles/` using 2.0-beta.7.4. Now TextMate recognizes files named babel.js and looks great. Thanks @CollinAllen. – Gardner Bickford Aug 18 '15 at 13:57
  • You *should* be able to just doubleclick on the .tmBundle to import it into TextMate. – Christopher Swasey Sep 06 '15 at 22:55
  • Upvoted but the pristine folder didn't exist for me. Just omitted that part of the path. – IAmNaN Jan 08 '16 at 21:19
2

Update

The JavaScriptNext.tmLanguage became obsolete since the official TextMate Javascript bundle now supports the new ES features.

Old answer below:


To have the most up-to-date version you should create a new bundle in the Bundle Editor File → New (⌘N), name it for convenience JavaScript Next:

enter image description here

Then, from the repo, open every .tmLanguage/.tmPreferences/.tmTheme file you want to use, and add it to your newly created bundle:

enter image description here

Now you should be able to select the JavaScript Next grammar:

enter image description here

Done!

Koen.
  • 25,449
  • 7
  • 83
  • 78