Feature Spotlight: TextMate bundles in PyCharm

Happy Friday everyone,

Today I’m going to shed some light on how to get syntax highlighting for unsupported languages and file types in PyCharm.

As you probably know, PyCharm supports only a limited number of languages and technologies. PyCharm supports them with intelligence that appears in code completion, smart navigation, refactorings, inspections, and suggestions. But sometimes you might need to edit some project-specific files of an unsupported file type. In PyCharm you can open any file and edit it right away, but it always helpful to get at least syntax highlighting for it. Thanks to the TextMate bundles support you can get syntax highlighting for a wide range of languages.

Let’s see how to enable highlighting for an unsupported language in PyCharm. For example, in your project you might have some shell scripts – PyCharm doesn’t support the Shell language by default, however there is a TextMate bundle available for it:

shell

Here is a few simple steps you take to enable the highlighting for the Shell language inside PyCharm:

1. First go to Settings (Preferences for Mac OS) and make sure that the “TextMate bundles support” plugin is installed and enabled:

plugin

2. Download a TextMate bundle. In my example I use the shellscript TextMate bundle from the official TextMate GitHub repo.
3. Open Settings again and go to Editor | TextMate Bundles:

settings

4. Click “+” and locate the bundle on your filesystem. After that the bundle appears in the list of recognized bundles:

selected

5. From this point you just need to click OK and enjoy the new syntax highlighting in the editor:

colored

That’s it! However, lets hold for a while and consider some additional settings you might want to adjust.
The first thing you’ll probably want to change is a syntax coloring scheme. This can be done in Settings | Editior | Textmate Bundles:

colorscheme

The second thing you’ll probably need is to adjust file types associations. For that go to Settings | Editor | File Types and choose the “Files supported via TextMate bundles” option.
Here you can modify the list of registered filename patterns and the ones that are ignored:

filetypes

Hope this post helps!
See you next week.

-Dmitry

About Dmitry Filippov

Product Marketing Manager at JetBrains
This entry was posted in Cool Feature. Bookmark the permalink.

7 Responses to Feature Spotlight: TextMate bundles in PyCharm

  1. Daniil says:

    Cool feature, it would be really useful at some cases.

    Can Pycharm has this TextMate bundles downloaded by defolt? Then this plugging would deserve to be activated by the standard installation.

    • Dmitry Filippov says:

      There’re a lot of different custom TextMate bundles spread over an internet and I don’t think that we should include all of them into installation and maintain by default. However the general idea is good and we might want to include some most popular ones. There’re also might be some licensing issues bundling it with PyCharm Pro – we need to check it. Anyway, thanks for the idea!

  2. Robert Zych says:

    Thanks for the tip Dmitry. I’ve installed the TextMate bundle for Make (https://github.com/textmate/make.tmbundle) and now I see some (but not all) syntax highlighting in my Makefile.

  3. Denis says:

    will this work with sublime?

  4. Daniel Staple says:

    Hmm – trying this feature for the first time in PyCharm 5.0.3 on Windows – with a php bundle.
    However – I see no highlighting. I can’t see any related issue in the idea.log either.
    What am I missing?

Leave a Reply

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