为Sublime文本3创建新语法

时间:2016-02-05 19:06:39

标签: yaml sublimetext3 syntax-highlighting

我正在尝试为Flex创建语法高亮显示。我正在使用PackageDev和YAML。

所以,我想找到一个块,从%{开始到%}结束,然后我需要突出显示这个块内的所有内容作为C ++代码。

我想到了两个变体,它们都不起作用:

# ...
# first
- begin: '%\{'
  end: '%\}'
  contentName:
    patterns:
    - include: source.c++ #  that's doesn't work

# second
- match: '%\{((?:.|\n)*)%\}' # regexpr works correctly
  name: source.c++
  captures:
    '1':
      - include: source.c++ # that's doesn't work too

1 个答案:

答案 0 :(得分:1)

有效:

- name: markup.italic.lex
  begin: '%\{'
  end: '%\}'
  patterns:
  - include: source.c++

手册thisthis。范围名称手册here