TextMate Bundles in PhpStorm

Projects may contain file types unknown to PhpStorm. While PhpStorm comes with built-in support for many programming and scripting languages, you may want to have syntax highlighting for project-specific languages. For example, a project may contain a shell script, or Perl. When doing infrastructure automation for your project using Puppet, a configuration file may exist in a project. TextMate, a text editor for Mac, offers syntax highlighting bundles for many languages. The good news is we can import them and use them in PhpStorm!

This functionality is available in IntelliJ Idea, PyCharm, WebStorm, PhpStorm, RubyMine, and AppCode.

Once a TextMate bundle is added, PhpStorm will provide syntax highlighting for the file types registered with the bundle. Here’s an example of a shell script opened in PhpStorm after installing the ShellScript TextMate bundle:

Shell script syntax highlighting in PhpStorm

Have a look at our tutorials page for more information how to configure TextMate bundles with PhpStorm!

As always, we appreciate your feedback in the comments below or in our forums!

Develop with pleasure!
– JetBrains PhpStorm Team

This entry was posted in Cool Feature and tagged , , , , . Bookmark the permalink.

17 Responses to TextMate Bundles in PhpStorm

  1. Henry Garcia says:


    Does not really work when adding Laravel-Blade textmate bundle. (https://github.com/Medalink/laravel-blade)

    I am not sure why? The bundle does account for .blade or .blade.php extensions but you still get not syntax highlighting or maybe is just the bundle itself.

  2. K says:

    It doesn’t highlighting all other html code? ( https://github.com/drnic/Handlebars.tmbundle )

  3. Peter Geil says:

    You tmBundle “importer” always chokes on this bundle: https://github.com/peta/turtle.tmbundle

    Can anybody reproduce this problem?

    • Maarten Balliauw says:

      Are you seeing any specific error messages?

      • Peter Geil says:

        No, once I selected the bundle folder, an according entry is added to the bundle list with a marked checkbox, but as soon as I click “Apply” or “OK” both, PHPStorm and RubyMine (each being the latest version) freeze and only a hard termination (via the quit now window on MacOS; CMD+ALT+ESC) helps. After I restarted the application, it works UNTIL I open up the application preferences and switch to the “TextMate Bundles” dialog pane (I’m doing nothing in there) — then the same game begins again. The only solution is to edit ~/Library/Preferences/WebIde60/options/textmate.xml and to remove the according BundleConfigBean.

        Maarten, before I file an issue, would you mind to download a ZIP of the bundle project from GitHub and try if it works for you? This would be very helpful for me as it might be a quick indication for whether the problem is specific to my setup or the bundle itself (so I can start to track down what makes the tmBundle importer choke) .

        • Maarten Balliauw says:

          Worst reply ever, but… it works on my machine. I di notice a small error during cloning but the bundle works.

          • Peter Geil says:

            “Worst reply ever” — why?

          • Maarten Balliauw says:

            Well from my side I thought it was the worst reply ever as “works on my machine” means I have no good explanation why it works on my side and not on yours. I see Alexander filed an issue for it, let me know if there’s anything else we can help you with.

          • pbyrne84 says:

            For those not in the joke “it works on my machine” is a statement made by developers who do not know their environment or how different environments can change how things work. Basically a person who says this == keyboard banging environment unaware monkeyCoder.

            So popular is the term you can buy t-shirts

            Basically Maarten is self deprectating himself and not you Peter .

      • Peter Geil says:

        Eeem … just to avoid confusion: “… After I restarted the application, it works …” doesn’t mean that the bundle-related functionality is available; I even didn’t try to open e.g. a *.ttl file.

        While re-reading my answer, another important question crossed my mind: How does your tmBundle importer apply the TextMate language grammar? There are several specifics TM bundle authors must be aware of (e.g. a document is matched line by line, meaning that true multiline regex patterns are not supported by TM) and that also coerce them to kind of workarounds in order to make a grammar work like they want it to do.

        Could you please elaborate a little bit on the internals of your tmBundle importer? That way authors (like me) whose bundles currently are broken could optimize their grammar to make it perfectly work with IntelliJ-based products.

        Some concrete questions:

        + How do you apply patterns? (single or multiline)
        + How do you map scopes?
        + What RE dialect do you support? (TM uses Oniguruma)
        + Is there (undocumented) functionality a language grammar can make use of that otherwise isn’t available in TM?

        Thanks in advance!


  4. Pingback: Laravel Blade Highlighter - Sublime Text | Laravel News

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">