问题
I'm trying to define a very basic .sublime-syntax
syntax-highlight file for Sublime Text 3.
I'm basing it on the first example in the Sublime Text 3 official documentation on Syntax Definitions:
%YAML 1.2
---
name: Z
file_extensions: z
scope: source.c
contexts:
main:
- match: \b(if|else|for|while)\b
scope: keyword.control.c
This file is /Users/justin/Library/Application Support/Sublime Text 3/Packages/User/z.sublime-syntax
(I left the scopes as .c
because I thought maybe the ST3 "theme" (e.g. Monokai) wouldn't know how to color "keyword.control.z".)
I restart Sublime Text 3 but in the lower-right language selection, no option for "Z" appears.
What am I doing wrong? Is there a way to ask Sublime if there was a parsing problem? How should I debug this?
Note: I've read this article, which describes TextMate-based syntax files, but that method is out-dated since ST3.
来源:https://stackoverflow.com/questions/41816312/creating-intsalling-a-simple-sublime-syntax-file-for-sublime-text-3