Sublime text multiple language syntax highlight?

杀马特。学长 韩版系。学妹 提交于 2019-12-14 03:21:28

问题


Is there something like multiple language highlight syntax in Sublime Text? For example my code might look like this:

{% extends "template.html" %}
{% block content %}
   {% if task == 'archimed_spiral' %}
       <p> 
           $\frac{2}{3}$
       </p>

   {% elif task == 'gcd' %}
   {% endif %}
{% endblock %}

Which is LaTeX inside html inside Jinja2. It gets pretty hard to read it properly. Note I know about Jinja2 package for Sublime, so it does highlight Jinja2 + html. Maybe I am just asking for too much..


回答1:


Yes you can embed syntax highlighting. You basically define a start and end pattern, then include an existing scope. See Sublime Text 2: Different language highlighting based on context? (a la Webstorm).



来源:https://stackoverflow.com/questions/22871014/sublime-text-multiple-language-syntax-highlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!