22

Is there any way to add custom language syntax highlighting to JetBrains IDE's?

In my case, i want to highlight MATLAB code in PyCharm. IDE is suggesting me 'Mathematica' plugin, which doesn't work correctly.

Carson
  • 6,105
  • 2
  • 37
  • 45
soupault
  • 6,089
  • 4
  • 24
  • 35

2 Answers2

16

You can add any syntax highlighting by importing a corresponding TextMate bundle to PyCharm or any other JetBrains IDE.

Here's a blog post covering this topic.

Topka
  • 2,001
  • 16
  • 13
  • 1
    Thanks, @Topka, got it! What about themes? Tried to add `tomorrow night` from https://github.com/textmate/TextMate-Tomorrow-Theme via `add bundle`, but it is not visible in listboxes below. Can you suggest something? – soupault Jul 20 '14 at 13:29
  • matlab.bundle is broken in some ways, btw. Not all the commented lines are marked with gray. Some of them are interpreted in colors of code :(. – soupault Jul 20 '14 at 13:33
  • 1
    @s0upa1t, there's a separate thread covering themes support: http://stackoverflow.com/questions/8506413/is-it-possible-to-import-textmate-themes-to-intellij-idea – Topka Jul 21 '14 at 09:33
  • Already found it, but it works in opposite direction (tm -> intellij) – soupault Jul 21 '14 at 17:38
  • I'm talking about this thing: Intellij theme is installed, corresponding bundle from textmate's github too. But it'is can't be recognized or shown. http://tinypic.com/r/nc1qi1/8 – soupault Jul 21 '14 at 18:02
14

For simple highlighting (without installing an IntelliJ plugin) you can simple create a new file type:

  • File | Settings | Editor | File Types - Add/Edit for Windows and Linux
  • IntelliJ IDEA | Preferences | Editor | File Types - Add/Edit for macOS

and configure presentation and highlighting of keywords, comments, numbers etc. in files of a specific custom file type.

TmTron
  • 17,012
  • 10
  • 94
  • 142