-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmTheme.rb
68 lines (63 loc) · 3.08 KB
/
tmTheme.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# encoding: utf-8
require 'plist'
class TmTheme
def initialize(name, author, settings)
@name = name
@author = author
@settings = settings
@fields = []
end
def []=(key, value)
@fields << { name: key, scope: SCOPES[key], settings: value}
end
def to_plist
{
author: @author,
name: @name,
settings: [{ settings: @settings }] + @fields,
uuid: '766026CB-703D-4610-B070-8DE07D967C5FE'
}.to_plist
end
SCOPES = {
"Comment" => "comment",
"Constant" => "constant",
"Entity" => "entity",
"Keyword" => "keyword",
"Storage" => "storage",
"String" => "string",
"Support" => "support",
"Variable" => "variable",
"Invalid – Deprecated" => "invalid.deprecated",
"Invalid – Illegal" => "invalid.illegal",
"♦ Embedded Source" => "text source",
"♦ Embedded Source (Bright)" => "text.html.ruby source",
"♦ Entity inherited-class" => "entity.other.inherited-class",
"♦ String embedded-source" => "string source",
"♦ String constant" => "string constant",
"♦ String.regexp" => "string.regexp",
"♦ String.regexp.«special»" => "string.regexp constant.character.escape, string.regexp source.ruby.embedded, string.regexp string.regexp.arbitrary-repitition",
"♦ String variable" => "string variable",
"♦ Support.function" => "support.function",
"♦ Support.constant" => "support.constant",
"c C/C++ Preprocessor Line" => "meta.preprocessor.c",
"c C/C++ Preprocessor Directive" => "meta.preprocessor.c keyword",
"✘ Doctype/XML Processing" => "meta.tag.sgml.doctype, meta.tag.sgml.doctype entity, meta.tag.sgml.doctype string, meta.tag.preprocessor.xml, meta.tag.preprocessor.xml entity, meta.tag.preprocessor.xml string",
"✘ Meta.tag.«all»" => "declaration.tag, declaration.tag entity, meta.tag, meta.tag entity",
"✘ Meta.tag.inline" => "declaration.tag.inline, declaration.tag.inline entity, source entity.name.tag, source entity.other.attribute-name, meta.tag.inline, meta.tag.inline entity",
"§ css tag-name" => "meta.selector.css entity.name.tag",
"§ css:pseudo-class" => "meta.selector.css entity.other.attribute-name.tag.pseudo-class",
"§ css#id" => "meta.selector.css entity.other.attribute-name.id",
"§ css.class" => "meta.selector.css entity.other.attribute-name.class",
"§ css property-name:" => "support.type.property-name.css",
"§ css property-value;" => "meta.property-group support.constant.property-value.css, meta.property-value support.constant.property-value.css",
"§ css @at-rule" => "meta.preprocessor.at-rule keyword.control.at-rule",
"§ css additional-constants" => "meta.property-value support.constant.named-color.css, meta.property-value constant",
"§ css constructor.argument" => "meta.constructor.argument.css",
"⎇ diff.header" => "meta.diff, meta.diff.header, meta.separator",
"⎇ diff.deleted" => "markup.deleted",
"⎇ diff.changed" => "markup.changed",
"⎇ diff.inserted" => "markup.inserted",
"Markup: List" => "markup.list",
"Markup: Heading" => "markup.heading"
}
end