{ "name": ".nanorc", "scopeName": "source.nanorc", "patterns": [ { "include": "#main" } ], "repository": { "colours": { "patterns": [ { "name": "meta.colour.nanorc", "begin": "^\\s*(i?color)(?=\\s|$)", "end": "$", "patterns": [ { "match": "\\G\\s*(,)(\\S+)", "captures": { "1": { "name": "punctuation.separator.delimiter.meta.comma.nanorc" }, "2": { "name": "entity.background.colour.name.nanorc" } } }, { "match": "\\G\\s*((?!,)\\S+)(,)(\\S+)", "captures": { "1": { "name": "entity.foreground.colour.name.nanorc" }, "2": { "name": "punctuation.separator.delimiter.meta.comma.nanorc" }, "3": { "name": "entity.background.colour.name.nanorc" } } }, { "match": "\\G\\s*([^\\s,]+)(,?)(?=\\s|$)", "captures": { "1": { "name": "entity.foreground.colour.name.nanorc" }, "2": { "name": "punctuation.separator.delimiter.meta.comma.nanorc" } } }, { "name": "meta.$1-pattern.nanorc", "match": "(?\u003c=\\s|\\G)(start|end)(=)(?=\\s|$)", "captures": { "1": { "name": "variable.parameter.attribute.nanorc" }, "2": { "name": "punctuation.definition.assignment.equals-sign.nanorc" } } }, { "name": "meta.$1-pattern.nanorc", "begin": "(?\u003c=\\s|\\G)(start|end)(=)(?=\")", "end": "(?\u003c=\")", "patterns": [ { "include": "#regexp" } ], "captures": { "1": { "name": "variable.parameter.attribute.nanorc" }, "2": { "name": "punctuation.definition.assignment.equals-sign.nanorc" } } }, { "include": "#regexp" } ], "beginCaptures": { "1": { "name": "storage.type.var.colour.name.nanorc" } } } ] }, "comment": { "name": "comment.line.number-sign.nanorc", "begin": "#", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.nanorc" } } }, "main": { "patterns": [ { "include": "#comment" }, { "include": "#colours" }, { "include": "#syntax" }, { "include": "#options" } ] }, "options": { "patterns": [ { "name": "meta.option.$2.nanorc", "begin": "^\\s*(set)\\s+(fill|tabsize)(?=\\s|$)", "end": "$", "patterns": [ { "name": "constant.numeric.integer.int.decimal.nanorc", "match": "[0-9]+" } ], "beginCaptures": { "1": { "name": "keyword.operator.$1.nanorc" }, "2": { "name": "entity.option.name.nanorc" } } }, { "name": "meta.option.$2.nanorc", "begin": "(?x) ^ \\s*\n(set|unset) \\s+\n(autoindent|backup|backwards|boldtext|casesensitive|const|cut\n|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp\n|nonewlines|nowrap|preserve|quickblank|rebinddelete|rebindkeypad\n|regexp|smarthome|smooth|suspend|tabstospaces|tempfile|view\n|wordbounds) (?=\\s|$)", "end": "$", "beginCaptures": { "1": { "name": "keyword.operator.$1.nanorc" }, "2": { "name": "entity.option.name.nanorc" } } }, { "name": "meta.option.$2.nanorc", "begin": "(?x) ^ \\s*\n(set) \\s+\n(backupdir|brackets|matchbrackets|operatingdir\n|punct|speller|whitespace) (?=\\s|$)", "end": "$", "patterns": [ { "include": "#string" } ], "beginCaptures": { "1": { "name": "keyword.operator.$1.nanorc" }, "2": { "name": "entity.option.name.nanorc" } } }, { "name": "meta.preprocessor.include.nanorc", "contentName": "storage.modifier.import.file-name.nanorc", "begin": "^\\s*(include)(?=\\s|$)\\s*", "end": "$", "beginCaptures": { "1": { "name": "keyword.control.directive.include.nanorc" } } }, { "name": "meta.option.$2.nanorc", "begin": "^\\s*(set)\\s+(quotestr)(?=\\s|$)", "end": "$", "patterns": [ { "include": "#regexp" } ], "beginCaptures": { "1": { "name": "keyword.operator.$1.nanorc" }, "2": { "name": "entity.option.name.nanorc" } } }, { "name": "meta.option.custom.nanorc", "begin": "^\\s*(?:(set|unset)\\s+)?(\\S+)", "end": "$", "patterns": [ { "name": "constant.logical.boolean.$1.nanorc", "match": "\\b(true|false|on|off|yes|no)\\b" }, { "name": "constant.numeric.decimal.nanorc", "match": "[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?=\\s|$)" }, { "include": "#regexp" } ], "beginCaptures": { "1": { "name": "keyword.operator.$1.nanorc" }, "2": { "name": "entity.option.name.nanorc" } } } ] }, "quotedString": { "name": "string.quoted.double.nanorc", "begin": "\"", "end": "\"(?=[^\"]*$)|(?=$)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.nanorc" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.nanorc" } } }, "regexp": { "name": "string.regexp.embedded.nanorc", "begin": "(\")\"?+", "end": "\"(?=\\s|$)|(?=$)", "patterns": [ { "match": "(?:\"(?!\\s|$))+" }, { "include": "source.regexp" } ], "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.nanorc" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.nanorc" } } }, "string": { "patterns": [ { "include": "#quotedString" }, { "include": "#unquotedString" } ] }, "syntax": { "patterns": [ { "name": "meta.syntax.nanorc", "match": "^\\s*(syntax)\\s+(none|default)(?=\\s|$)", "captures": { "1": { "name": "storage.type.var.syntax.name.nanorc" }, "2": { "name": "support.constant.language.$2.nanorc" } } }, { "name": "meta.syntax.nanorc", "begin": "^\\s*(syntax)(?:\\s+((\")[^\"]+(\")|\\S+)(?:\\s+(.*))?)?\\s*$\\s*", "end": "^(?=\\s*syntax)", "patterns": [ { "include": "#main" } ], "beginCaptures": { "1": { "name": "storage.type.var.syntax.name.nanorc" }, "2": { "name": "entity.syntax.name.nanorc" }, "3": { "name": "punctuation.definition.name.begin.nanorc" }, "4": { "name": "punctuation.definition.name.end.nanorc" }, "5": { "patterns": [ { "include": "#regexp" } ] } } } ] }, "unquotedString": { "name": "string.unquoted.bareword.nanorc", "match": "\\S+" } } }