我想为Sublime中的某些命令分配不同的颜色,以便在浏览文件时可以轻松看到它们。
例如,我正在为LaTeX使用Monokai配色方案,该方案可以提供浅蓝色命令,例如\chapter
,\label
,\footnote
等。对于我的论文,我计划使用 changes -package,以便我的主管可以编辑和评论我的工作。该软件包随附\added
,\deleted
等命令。这些命令也显示为浅蓝色。我希望这些产品能脱颖而出,例如橙色。
我尝试使用“ LaTeX.sublime-syntax”文件和“ Monokai.sublime-color-scheme”,但仅成功突出显示了非功能性单词。
这是我在语法文件中使用的代码:
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: LaTeX
file_extensions:
- tex
- ltx
scope: text.tex.latex
contexts:
prototype:
- include: comments
main:
- comment: Words
match: \b(?i)(?:added|deleted)\b
scope: variable.language
- include: unique-latex
- include: packages
- include: plain-tex
- include: begin-end-commands
- include: general-commands
- include: global-braces
这是来自颜色方案文件:
"name": "Language variable",
"scope": "variable.language",
"foreground": "var(orange)",
"font_style": "italic"
},