Skip to content

Instantly share code, notes, and snippets.

@glachancecmaisonneuve
Created February 6, 2019 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glachancecmaisonneuve/aa0a2a9018bde315a4b5e30aec0a1f4c to your computer and use it in GitHub Desktop.
Save glachancecmaisonneuve/aa0a2a9018bde315a4b5e30aec0a1f4c to your computer and use it in GitHub Desktop.
{
"name": "Ini",
"scopeName": "source.ini",
"patterns": [
{
"begin": "(^[ \\t]+)?(?=#)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.ini"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "#",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.ini"
}
},
"end": "\\n",
"name": "comment.line.number-sign.ini"
}
]
},
{
"begin": "(^[ \\t]+)?(?=;)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.ini"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": ";",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.ini"
}
},
"end": "\\n",
"name": "comment.line.semicolon.ini"
}
]
},
{
"captures": {
"1": {
"name": "keyword.other.definition.ini"
},
"2": {
"name": "punctuation.separator.key-value.ini"
}
},
"match": "\\b([^=]+)\\b\\s*(=)"
},
{
"captures": {
"1": {
"name": "punctuation.definition.entity.ini"
},
"3": {
"name": "punctuation.definition.entity.ini"
}
},
"match": "^(\\[)(.*?)(\\])",
"name": "entity.name.section.group-title.ini"
},
{
"begin": "=\\s*\\K\\s*'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.ini"
}
},
"end": "(?<!\\\\)(?:\\\\\\\\)*\\K'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.ini"
}
},
"name": "string.quoted.single.ini",
"patterns": [
{
"include": "#escape"
}
]
},
{
"begin": "=\\s*\\K\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.ini"
}
},
"end": "(?<!\\\\)(?:\\\\\\\\)*\\K\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.ini"
}
},
"name": "string.quoted.double.ini",
"patterns": [
{
"include": "#escape"
}
]
},
{
"begin": "=\\s*\\K`",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.ini"
}
},
"end": "(?<!\\\\)(?:\\\\\\\\)*\\K`",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.ini"
}
},
"name": "string.interpolated.ini",
"patterns": [
{
"include": "#escape"
}
]
},
{
"begin": "=\\s*(?!$)\\K",
"contentName": "string.unquoted.ini",
"end": "\\s*(?=[\\n;#])",
"patterns": [
{
"include": "#escape"
},
{
"match": "\\b[0-9]+\\b",
"name": "constant.numeric.ini"
}
]
}
],
"repository": {
"escape": {
"match": "\\\\.",
"name": "constant.character.escape.ini"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment