Custom syntax highlighting in JetBrains IDE's

2019-02-12 01:05发布

问题:

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.

回答1:

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.



回答2:

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.