Last active
October 25, 2020 03:55
-
-
Save disco0/71a5ea47ddf43ea2ba343e5c5b7fa65e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
/** | |
* Extension: fabiospampinato.vscode-highlight | |
* For use in user's main/project settings file (settings.json). | |
*/ | |
{ | |
// ... | |
// @region Decorators / Styling | |
// Highlight Decorator - highlight.options | |
"highlight.maxMatches": 500, | |
"highlight.decorations": { "rangeBehavior": 1 }, | |
"highlight.regexFlags": "gi", | |
/** | |
* Regex Notes: | |
* - JS Escape Codes: \\[bfnrtv0'"\\] | |
* https://mathiasbynens.be/notes/javascript-escapes | |
* https://mothereff.in/js-escapes | |
*/ | |
"highlight.regexes": { | |
// Highlight • (Type|Java)script => Userscript Meta | |
"^(?:(// +)(?:(@noframes)([ \\t]*$)|(@(?:include|match|grant|require))([\\t ]+)(?:(https?.+?)|(.+))(\\**)([ \\t]*)|(^//[ \\t]+)(@(?:author|name(?:space)?|version|description))([ \\t]+)(.+?)([ \\t]*)|(^//[ \\t]+)(@resource)([ \\t]+)(\\S+)([ \\t]+)(\\S+)([ \\t]*))(\\n(?://[ \\t]*\\n)*))": { | |
"filterLanguageRegex": "(java|type)script", | |
"regexFlags": "gm", | |
"decorations": [ | |
// // (For all cases) | |
{ | |
}, | |
// @noframes | |
{ // @noframes | |
"fontWeight": "600", | |
"color": "#BB0034", | |
"fontStyle": "oblique" | |
}, | |
// @include @match | |
{ }, | |
{ | |
"color": "#BB0034", | |
"fontStyle": "oblique", | |
}, | |
{ }, | |
{ | |
"textDecoration": "underline", | |
"color": "#0000FF" | |
}, | |
{ | |
"color": "#0044CC", | |
"fontWeight": "600" | |
}, | |
{ | |
"textDecoration": "underline #0000FF", | |
"color": "#DD55AA", | |
"fontWeight": "600" | |
}, | |
{ }, | |
// @name | |
{ }, | |
{ | |
"color": "#0044CC", | |
"fontStyle": "oblique" | |
}, | |
{ }, | |
{ | |
"color": "#0055AA", | |
"fontWeight": "600" | |
}, | |
{ | |
"color": "#DD55AA", | |
"fontWeight": "600" | |
}, | |
// @resource | |
{ }, | |
{ | |
"color": "#0044CC", | |
"fontStyle": "oblique", | |
}, | |
{ }, | |
{ | |
"color": "#BB0034", | |
"fontStyle": "oblique", | |
"fontWeight": "600" | |
}, | |
{ }, | |
{ | |
"textDecoration": "underline", | |
"color": "#0000FF", | |
}, | |
{ | |
"color": "#DD55AA", | |
"fontWeight": "600" | |
}, | |
{ } | |
] | |
}, | |
// Highlight • (Type|Java)script => Multiline Type Body | |
// // Extended form with detailed groups | |
// "(@\\w+)([ \\t])(\\{{2})([\\S\\s]+?)(\\}{2})([ \\t]+)(\\w+)(?=[\\S\\s]+?(?=\\*\\/))": { | |
// // Simple capture, just to fix the incorrect error scope | |
// // Actually no this is broken, narrowing match to only @param | |
"(@param+)([ \\t]+\\{{2}[\\S\\s]+?\\}{2}[ \\t]+)(\\w+)(?=[\\S\\s]+?(?=\\*\\/))": { | |
"filterLanguageRegex": "(java|type)script", | |
"regexFlags": "gm", | |
"decorations": [ | |
{ }, | |
{ | |
"color": "#408CFF", | |
"fontStyle": "oblique", | |
"textDecoration": "unset", | |
"fontWeight": "initial" | |
}, | |
{ "color": "#318495", "fontWeight": "600", "fontStyle": "oblique" }, | |
{ "color": "#318495" }, | |
{ "color": "#318495" }, | |
] | |
}, | |
// Highlight • (Type|Java)script, tsconfig, OpenSCAD => Region comments | |
// WIP "^([ \\t]*)(?=[\\/]{2}[#])(?:(.{0})([\\/]{2})(#)(region)(:)?|()([\\/]{2})(#)(endregion)(:)?)([ ])(.+?)([ \\t]*)$": { | |
"^([ \\t]*)([\\/]{2})(?:()(#)(region)(:)?|()(#)(endregion)(:)?)([ ])(.+?)([ \\t]*)$": { | |
"filterLanguageRegex": "(java|type)script|scad|json", | |
// "filterFileRegex": "", | |
"regexFlags": "gmi", | |
"decorations": [ | |
// Group • Beginning whitespace | |
{ }, | |
// Group • Begin comment | |
{ | |
"opacity": "0.5", | |
"fontWeight": "500" | |
}, | |
// Group • #|region | |
{ | |
"isWholeLine": true, | |
"borderColor": "#1188CC18", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
{ | |
"opacity": "0.5", | |
"fontWeight": "500" | |
}, | |
{ | |
"color": "#06C", | |
"opacity": "1", | |
"fontWeight": "600" | |
}, | |
{ | |
// "color": "#AA0000", | |
"opacity": "0.5", | |
"fontWeight": "600" | |
}, | |
// Group • #|endregion | |
{ | |
"isWholeLine": true, | |
// "backgroundColor": "#00FFFF03", | |
"opacity": "0.6" | |
}, | |
{ | |
// "color": "#00AACC", | |
"opacity": "0.5", | |
"fontWeight": "600" | |
}, | |
{ | |
// "color": "#00AACC", | |
"opacity": "0.5", | |
"fontWeight": "600" | |
}, | |
{ | |
// "color": "#00AACC", | |
"opacity": "0.5", | |
"fontWeight": "600" | |
}, | |
// Group • Space separator, Region description | |
{ }, | |
{ | |
"color": "#CC0000", | |
"opacity": "1", | |
"fontStyle": "unset" | |
}, | |
// Group • Ending whitespace | |
{ "color": "hsla(210, 100%, 70%, 1)", | |
"fontWeight": "600" | |
// "textDecoration": "; box-shadow: 0 0px 0 hsla(219, 100%, 30%, 0), 0px 2px 0px hsla(210, 100%, 70%, 1);" | |
} | |
] | |
}, | |
// Section Comments | |
//1 2 3 4 5 6 7 8 | |
"^([ ]*)(//)(#)(section())([ ]+)(.+?)([ \\t]*$)": | |
{ | |
"filterLanguageRegex": "(java|type)script|scad|json", | |
// "filterFileRegex": "", | |
"regexFlags": "gmi", | |
"decorations": | |
[ | |
{ // [1] [whitespace] | |
}, | |
{ // [2] // | |
"opacity": "0.5" | |
}, | |
{ // [3] # | |
"color": "#A00", | |
}, | |
{ // [4] section | |
"backgroundColor": "#2288FF06", | |
"color": "#A00", | |
}, | |
{ // [5] [linestyle] | |
"isWholeLine": true, | |
// "opacity": "0.5", | |
// "fontWeight": "600" | |
}, | |
{ // [6] [whitespace] | |
"fontWeight": "600" | |
}, | |
{ // [7] Section Description | |
"opacity": "1", | |
"color": "#06C", | |
}, | |
{ // [8] [whitespace::eol] | |
"isWholeLine": true, | |
"backgroundColor": "#00FFFF03", | |
"opacity": "0.6" | |
}, | |
] | |
}, | |
// Highlight • (Type|Java)script => require | |
/** | |
* Beginning groups are basic sanity checks to avoid highlighting | |
* incorrect tokens, while somewhat flexible in detecting a require | |
* the call should be somewhat regular (just don't use vertical or | |
* after the require)> | |
* For example: | |
* require('thing') | |
* Not: | |
* require(// WHEEEEE | |
* | |
* 'thing' | |
* ) | |
*/ | |
"([=:][\\s\\n]*\\b)(require(?=[\\(]))([\\(])(['])((?:[^\\n\\r\\t']+|\\')+)(['])([\\)])": { | |
"filterLanguageRegex": "(type|java)script.*", | |
"regexFlags": "g", | |
"decorations": [ | |
// Group • Pre `require` | |
{ }, | |
// Group • Token `require` | |
{ "color": "#FF0000CC", | |
"fontStyle": "italic;", | |
"fontWeight": "700" | |
}, | |
// Group • require Call Entry Paren | |
{ "color": "#AAA", | |
"opacity": "0.3" | |
}, | |
// Group • require Call Quotation Beginning Char | |
{ "color": "#AAA", | |
"opacity": "0.7" | |
}, | |
// Group • require Call Requirement String | |
{ "color": "#00AA44", | |
"textDecoration": "; box-shadow: 0px 1.5px 0px #00AA00AA;" | |
}, | |
// Group • require Call Quotation Ending Char | |
{ "color": "#AAA", | |
"opacity": "0.7" | |
}, | |
// Group • require Call Closing Paren | |
{ "color": "#AAA", | |
"opacity": "0.3" | |
} | |
] | |
}, | |
// Highlight • Settings.json => Extension / Subgroup Sections | |
"^([ \\t]*)([\\/]{2}[ \\t]+)(.+)([\\t ]*[ ]+[\\-][ ][\\t ]*)(.+\\.options)": { | |
"filterFileRegex": "settings\\.json|\\.code-workspace", | |
"regexFlags": "gmi", | |
"decorations": [ | |
// Group • Indent, Comment Token, Whitespace | |
{ }, { }, | |
// Group • Description | |
{ "color": "hsla(215, 100%, 60%, 1)", | |
"fontStyle": "italic; -webkit-text-stroke: 0.0125em;", | |
"fontWeight": "500" | |
}, | |
// Group • Whitespace wrapped dash | |
{ }, | |
// Group • Options keyword form | |
{ "color": "hsla(210, 100%, 70%, 1)", | |
"fontWeight": "600", | |
"textDecoration": "; box-shadow: 0 0px 0 hsla(219, 100%, 30%, 0), 0px 2px 0px hsla(210, 100%, 70%, 1);" | |
} | |
] | |
}, | |
// Highlight • Settings.json => Extension / Subgroup Sections | |
"([ \\t]*)([\\/]{2})([ \\t]+)([@]region\\b)([ ][ ]*?)([ ]?\\b.+?[ ]?)([ ]*$)": { | |
"filterFileRegex": "settings\\.json|\\.code-workspace", | |
"regexFlags": "gm", | |
"decorations": [ | |
// Group • Indent, Comment Token, Whitespace | |
{ }, { }, { }, | |
// Group • @region | |
{ | |
"color": "hsla(215, 100%, 60%, 1)", | |
"fontStyle": "italic; -webkit-text-stroke: 0.0125em;", | |
"fontWeight": "700" | |
}, | |
// Group • Controlled Padding | |
{ "width": "3em" }, | |
// Group • Description | |
{ | |
"color": "#EDEDED", | |
"backgroundColor": "hsla(210, 100%, 60%, 1)", | |
"fontWeight": "700", | |
"before": { | |
"contentText": "▓▒░ ", | |
"opacity": "1", | |
// Old injection | |
// "textDecoration": "; font-size: inherit; text-align: left; ", | |
// New injection - Fills out accents vertically | |
"textDecoration": "; font-size: 105%; text-align: left; margin-right: -0.04em;", | |
"color": "#EDEDED", | |
"backgroundColor": "hsla(210, 100%, 60%, 1)" | |
}, | |
"after": { | |
"contentText": " ░▒▓", | |
"opacity": "1", | |
// Old injection | |
// "textDecoration": "; font-size: inherit; text-align: right; ", | |
// New injection - Fills out accents vertically | |
"textDecoration": "; font-size: 105%; text-align: right; margin-left: -0.04em;", | |
"color": "#EDEDED", | |
"backgroundColor": "hsla(210, 100%, 60%, 1)" | |
}, | |
}, | |
// Group • Whitespace | |
{ } | |
] | |
}, | |
"([\\/]{2}(?=[ ]*[@]region[ ]+(Decorators|Folding)|[ ]+Sync[ ]-[ ]settingsSync.options|[ ]*Highlight[ ]+Decorator[ ]+-[ ]+highlight\\.options))": { | |
"filterFileRegex": "settings\\.json|\\.code-workspace", | |
"regexFlags": "", | |
"decorations": [ | |
{ | |
"overviewRulerLane": "full", | |
"overviewRulerColor": "#ff0000", | |
"before": | |
{ | |
"contentText": "#", | |
"color": "red", | |
"fontWeight": "700", | |
"fontStyle": "unset", | |
"width": "1em", | |
"border": "1px solid red", | |
"height": "100%", | |
"textDecoration": "; border-width: 0 0 0 0.25em ; padding-left: 0.25em; font-size: 100%; margin-left: -1.5em; position: absolute;" | |
} | |
} | |
] | |
}, | |
// Highlight • Settings.json => highlight.regexes FileType Section Header | |
// Capture all sections of header separately and highlight details | |
// "^([ ]+)([\\/]{2}[ ]+)(Highlight)([ ]+•[ ]+)([\\S].+?[\\S])([ ]*(?:[\\/]{2})?)$": { | |
"^([ \\t]+[\\/]{2}[ ])(Highlight)([ ]•[ ])(.+)$": { | |
"filterFileRegex": "settings[\\.]json|\\.code-workspace", | |
"regexFlags": "gmi", | |
"decorations": [ | |
// Group • Beginning Whitespace / Comment Delimiter | |
{ | |
"backgroundColor": "hsla(215, 20%, 92%, 1)", | |
"isWholeLine": true | |
// "color": "#2288CC80" | |
}, | |
// Group • Highlight keyword | |
{ "color": "#50a7e0", | |
"fontWeight": "600" | |
}, | |
// Group • Bulletpoint, and surrounding whitespace | |
{ }, | |
// Group • Subsection name, and a single space of padding if available | |
{ | |
"color": "#F05070AA", | |
"fontWeight": "600" | |
}, | |
{ | |
"opacity": "0.3", | |
// "before": { | |
// "textDecoration": "; position: absolute", | |
// "contentText": "▓▒░", | |
// "fontSize": "100%", | |
// "color": "hsla(215, 20%, 92%, 1)" | |
// } | |
} | |
] | |
}, | |
// Highlight • Settings.json => Misc. | |
"([\\{])(LANG|appname|currentcolumn|currentline|dirname|filename|filesize|fulldirname|gitbranch|gitreponame|lang|null|totallines|workspace|workspaceFolder)([\\}])": { | |
"filterFileRegex": "settings\\.json|[\\.]code-workspace", | |
"regexFlags": "gm", | |
"decorations": [ | |
{ "color": "#CC0088", "fontStyle": "oblique", "opacity": "0.7" }, | |
{ "color": "#CC0099", "fontStyle": "oblique", "opacity": "1" , "fontWeight": "600" }, | |
{ "color": "#CC0088", "fontStyle": "oblique", "opacity": "0.7" } | |
] | |
}, | |
// Highlight • Settings.json => Sync Preferences | |
// "(^\\s*)(// @sync )(?:(os=)(\\w+)|(\\w+.+?))(\\s*$)": { | |
// // "regexFlags": "gmi", | |
// "filterFileRegex": "settings\\.json|\\.code-workspace", | |
// "regexFlags": "gmi", | |
// "decorations": [ | |
// // {} | |
// ] | |
// }, | |
// Highlight • Settings.json => highlight.regexes Capture Group Description | |
// Filetype Headers - Capture all sections of header separately and highlight details | |
// "^([ ]+)([\\/]{2}[ ]+)(Group)([ ]+•[ ]+)([^ ].+?[^ ])([ ]*$)": { | |
// "filterFileRegex": "settings[\\.]json|[\\.]code-workspace", | |
// "regexFlags": "gmi", | |
// "decorations": [ | |
// // Group • Beginning Whitespace | |
// { }, | |
// // Group • Begin Comment Defininition | |
// { | |
// "color": "#7799DD80", | |
// "fontWeight": "500", | |
// }, | |
// // Group • Group keyword | |
// { | |
// "color": "#2288CC80", | |
// "fontWeight": "500", | |
// }, | |
// // Group • Bulletpoint, and surrounding whitespace | |
// { | |
// "color": "#2288CC80" | |
// }, | |
// // Group • Subsection name, and a single space of padding if available | |
// { | |
// "color": "#50B04080", | |
// "fontWeight": "600", | |
// }, | |
// // Group • Any additional whitespace at the end of the line. | |
// { "after": { | |
// "contentText": "▓▓▒░▒░░", | |
// "textDecoration": "; position: absolute;", | |
// "color": "hsla(205, 20%, 90%, .8)", | |
// "backgroundColor": "#88888800" | |
// } } | |
// ] | |
// }, | |
// Highlight • json => Quoted Regexp Escapes | |
// Advanced | |
// "(?:([\\\\]{2})(\\1)|(?:([\\\\])([\\\\][sSV]))+|(?:([\\\\])([\\\\][nbBdD]))+|(?:([\\\\])([\\\\])([\\[\\]\\)\\(\\{\\}])|(?:([\\\\])([\\\\])([\\+\\?\\*\\^\\$\\/])))|([\\\\](?:[\\\\]{2})*)(?=![\\\\]))": { | |
// 1 2 3 4 5 6 7 8 9 10 11 12 13 | |
"(?:([\\\\]{2})(\\1)|(?:([\\\\])([\\\\][sS]))+|(?:([\\\\])([\\\\][nbB]))+|(?:([\\\\])([\\\\])([\\[\\]\\)\\(\\{\\}])|(?:([\\\\])([\\\\])([\\?\\*\\^\\$\\/\\|])))|([\\\\](?:[\\\\]{2})*)(?=![\\\\]))": { | |
"filterLanguageRegex": "^jsonc?$", | |
"regexFlags": "gm", | |
"decorations": [ | |
{ // > \\\\ (\\__) | |
// "backgroundColor": "#22AACC40", | |
"opacity": "0.5", | |
"color": "#AACCFF", | |
"border": "dashed 0.75px #00337780", | |
"borderStyle": "none none dashed none", | |
// "textDecoration": "; box-shadow: 0 -0.225em 0 0 #0AA", | |
"fontWeight": "500", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\\\ (__\\) | |
// "backgroundColor": "#22AACC40", | |
"color": "#2066FF", | |
"border": "dashed 0.75px #00337780", | |
"borderStyle": "none none dashed none", | |
// "textDecoration": "; box-shadow: 0 -0.225em 0 0 #0AA", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\s \\S | |
"color": "#27c2", | |
// "borderWidth": "dashed 0.75px #27c8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "500", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\s | |
"color": "#23c", | |
// "border": "dashed 0.75px #27c8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\n \\b \\B | |
"color": "#71A2", | |
// "border": "dashed 0.75px #71A8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\n \\b \\B | |
"color": "#71A", | |
// "border": "0.75px #71A8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\} \\{ \\) \\( \\[ \\] | |
"color": "#4444EE", | |
// "color": "#3db1ff", | |
"opacity": "0.325", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\} \\{ \\) \\( \\[ \\] | |
"color": "#0033bb", | |
// "opacity": "0.7", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\} \\{ \\) \\( \\[ \\] | |
"color": "#0000BB", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\* \\^ \\? | |
"color": "#D51015", | |
// "color": "#3db1ff", | |
"opacity": "0.3", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\* \\^ \\? | |
// "color": "#31e249", | |
"color": "#D51015", | |
// "opacity": "0.8", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ // > \\* \\^ \\? | |
"color": "#D51015", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600", | |
"rangeBehavior": 1 | |
}, | |
{ | |
"color": "#0F02", | |
"rangeBehavior": 1 | |
}, | |
{ | |
"color": "#0F0", | |
"textDecoration": "; box-shadow: 0 0.06125em 0 0 ", | |
"fontWeight": "700" , | |
"rangeBehavior": 1 | |
}, | |
{ | |
"color": "#0AA2" | |
}, | |
{ | |
"color": "#0AA", | |
"textDecoration": "; box-shadow: 0 0.06125em 0 0 ", | |
"fontWeight": "700" }, | |
{ | |
"backgroundColor": "#F00" | |
} | |
] | |
}, | |
// Regexp metacharacters (*, $, +) | |
// "(?<!^.*[\\/]{2}.*)([\\.](?:[\\*\\+]|[\\?](?![!:]|[<]?[=!]))(?<=[^\\\\\\n](?:[^\\\\\\n]{2})*.)|(?:[\\$\\+\\*]|[\\?](?![!:]|[<]?[=!]))(?<=[^\\\\\\n](?:[^\\\\\\n]{2})*))": { | |
// // "filterLanguageRegex": "json", | |
// "filterFileRegex": "settings\\.json|\\.code-workspace", | |
// "regexFlags": "gmi", | |
// "decorations": [ | |
// { "color": "#D51015" } | |
// ], | |
// }, | |
//1 2 3 4 | |
// "([^\\\\])([\\[])((?:[^\\]\\\\]+|(?:[\\\\](?:[\"]|[\\\\][^\\\\\"])+)+?)+?)((?<![\\\\])[\\]])": { | |
// "filterLanguageRegex": "json", | |
// "regexFlags": "gm", | |
// "decorations": [ | |
// { "color": "#EE0044" }, | |
// { }, | |
// { "color": "#EE0044" }, | |
// ] | |
// }, | |
// Highlight • Filetype Headers: Capture entire body of comment for a global decorator | |
// "^([ ]*)([\\/]{2}[ ]+(?:Group[s]?)[ ]+[•][ ]+.*[^\\n\\s][ ]?)([ ]*)$": { | |
// "filterFileRegex": "settings\\.json|[\\.]code-workspace", | |
// "regexFlags": "gmi", | |
// "decorations": [ | |
// // Group • Indent Whitespace | |
// { }, | |
// // Group • Comment Body | |
// { | |
// "backgroundColor": "hsla(205, 20%, 90%, 1)", | |
// "borderRadius": "2px" | |
// }, | |
// // Group • Trailing Whitespace | |
// { } | |
// ] | |
// }, | |
// Highlight • Textmate Snippets => Placeholders | |
"(\\$)(?:(TM_[A-Z]+(?:_[A-Z]+)*)|([\\d])|([\\{])(?:(TM_[A-Z]+(?:_[A-Z]+)*)|([\\d]))(?:(.+?(?=[\\}])))?(?:([\\/])(.+?)((?<![\\\\]{2})[\\/])(.+?)(?:(?<![\\\\]{2})[\\/])(\\w*))?([\\}]))": { | |
"filterFileRegex": "code-snippets|((type|java)script|shellscript|jsonc?|powershell)\\.json", | |
"regexFlags": "gmi", | |
"decorations": [ | |
// Group • Start: $ | |
{ | |
"color": "#0088AAEE", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
}, | |
// Groups • Non-bracketed variable name token | |
{ // TM_* | |
"color": "#0066CC", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ // \d | |
"color": "#0066CC", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
// Groups • Bracketed Variable body | |
// Open Bracket | |
{ | |
"color": "#0088AACC", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
}, | |
// Groups • Variable Name | |
{ // TM_* | |
"color": "#0066CC", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ // \d | |
"color": "#0066CC", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
// Groups • Default Values | |
{ | |
"color": "#9900AA", | |
"fontStyle": "italic", | |
"fontWeight": "500" | |
}, | |
{ | |
"color": "#00AA66", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ | |
"color": "#0033FF", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ | |
"color": "#FF0077", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ | |
"color": "#000000", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ | |
"color": "#FF0077", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
// Closing bracket | |
{ | |
"color": "#0088AACC", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
} | |
] | |
}, | |
// Highlight • keybindings.json => Regions | |
"^([ ]{2}(?:[ ]{2})?)([\\/]{2}[ ]?)([@#](?:section|region))([ ])(.+?)([\\t ]*)$": { | |
"regexFlags": "gm", | |
"filterFileRegex": "keybindings\\.json", | |
"decorations": [ | |
{ | |
"isWholeLine": true, | |
"backgroundColor": "#AAEEFF10" | |
}, | |
{ | |
"borderStyle": "none none outset none", | |
"borderWidth": "1px", | |
"borderColor": "#0033CC20" | |
}, | |
{ | |
"color": "#CC0099", | |
"fontStyle": "italic", | |
"borderStyle": "none none outset none", | |
"fontWeight": "700", | |
"borderWidth": "0.125em", | |
"borderColor": "#0033CC20" | |
}, | |
{ | |
"borderStyle": "none none outset none", | |
"borderWidth": "1px", | |
"borderColor": "#0033CC20" | |
}, | |
{ | |
"color": "#003399", | |
"fontWeight": "700", | |
"borderStyle": "none none outset none", | |
"borderWidth": "1px", | |
"borderColor": "#0033CC20" | |
}, | |
{ | |
"borderStyle": "none none outset none", | |
"borderWidth": "1px", | |
"borderColor": "#0033CC20" | |
} | |
] | |
}, | |
// 1 2 3 4 | |
"([/]{2})(?<=^[\\s]+[\\{] \\1)([ ]+)(\\S.+?)(\\s*$)": { | |
"regexFlags": "gm", | |
"filterFileRegex": "keybindings\\.json", | |
"decorations": [ | |
{ | |
"opacity": "0.5" | |
}, | |
{ | |
"opacity": "0.5" | |
}, | |
{ | |
"color": "#b8006e", | |
"opacity": "0.5", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ } | |
] | |
}, | |
// Highlight • VSCode Configuration API => When clause Regexps | |
"([\\w\\._]+)([\\t ]*)(=~)([\\t ]*)([\\/])(.+?)((?<![\\\\]{2})\\5)": { | |
"filterFileRegex": "(package|keybindings)\\.json", | |
"regexFlags": "gmi", | |
"decorations": [ | |
{ "backgroundColor": "#8881", "color": "#03A", "fontWeight": "600", "fontStyle": "unset" }, | |
{ "backgroundColor": "#8881"}, | |
{ "backgroundColor": "#8881","color": "#9b0101", "fontWeight": "600", "fontStyle": "unset" }, | |
{ "backgroundColor": "#8881"}, | |
{ "backgroundColor": "#8881","color": "#089c41", "fontStyle": "italic" }, | |
{ "backgroundColor": "#8881","color": "#D07", "fontWeight": "600", "fontStyle": "italic" }, | |
{ "backgroundColor": "#8881","color": "#089c41", "fontStyle": "italic" } | |
] | |
}, | |
"(?<=^[ ]{6})([\\w\\.]+)([ ]+)(.+)|(?<=^ )(- )([\\w ]+)": { | |
"filterFileRegex": "keybindings\\.json", | |
"regexFlags": "gmi", | |
"decorations": [ | |
{ "color": "#11CC", "fontWeight": "600", "fontStyle": "unset" }, | |
{ }, | |
{ "color": "#200D", "fontWeight": "500", "fontStyle": "unset" }, | |
{ "fontStyle": "unset", "fontWeight": "600", "color": "#008" }, | |
{ "textDecoration": "underline","fontStyle": "unset", "fontWeight": "600", "color": "#008" } | |
] | |
}, | |
// Highlight • keybindings.json => Keybinding Property Name | |
"(\"key\")|(\"command\")|(\"when\")": { | |
"filterFileRegex": "keybindings\\.json", | |
"regexFlags": "gm", | |
"decorations": [ | |
{ | |
// "color": "#BB0000", | |
"textDecoration": "; box-shadow: 0 0.125em #BB000060" | |
}, | |
{ | |
"textDecoration": "; box-shadow: 0 0.125em #00AA0060" | |
}, | |
{ | |
"textDecoration": "; box-shadow: 0 0.125em #0055CC60" | |
} | |
] | |
}, | |
// Highlight • Lua => Region Comments | |
"^([ \\t]*)(?:(--)(region)()([ ][ ]*)(.+?)$([ \\t]*)|(--)(endregion)())": { | |
"regexFlags": "gm", | |
"filterFileRegex": ".*\\.lua", | |
"decorations": [ | |
{ // [1] [whitespace] | |
}, | |
// Group • -- | region | |
{ | |
"color": "#408CFF", | |
"fontWeight": "500", | |
"opacity": "0.5" | |
}, | |
{ | |
"color": "#408CFF", | |
"fontWeight": "600", | |
"opacity": "0.5" | |
}, | |
// Group • --region Line styling | |
{ | |
"isWholeLine": true, | |
"borderColor": "#1188CC18", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
// Group • Middle Whitespace | |
{ | |
// "borderStyle": "none" | |
}, | |
// Group • Region description | |
{ | |
"textDecoration": "; box-shadow: 0 0.0625em 0 0 #11AAEE80", | |
"color": "#0099FF", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
}, | |
// Group • -- | endregion | |
{ | |
"color": "#408CFF", | |
"fontWeight": "600", | |
"opacity": "0.5" | |
}, | |
{ | |
"color": "#408CFF", | |
// "color": "#0077AA", | |
"fontWeight": "500", | |
"opacity": "0.5" | |
}, | |
{ | |
"isWholeLine": true, | |
"opacity": "0.5" | |
} | |
] | |
}, | |
// Highlight • zsh => powerlevel10k Configuration Sections | |
"^( ####)(\\[[^\\n#]+\\])(#+[ ]*)$": { | |
"regexFlags": "gmi", | |
"filterFileRegex": "\\.p10k\\.zsh", | |
"decorations":[ | |
{ | |
"color": "#408CFF60", | |
"opacity": "0.4" | |
}, | |
{ | |
"color": "#0099DD", | |
"fontStyle": "italic", | |
"fontWeight" : "700" | |
}, | |
{ | |
"color": "#408CFF60", | |
"opacity": "0.4" | |
} | |
] | |
}, | |
// Highlight • zsh => Region comments | |
// Keeping lookbehind simple for now | |
// 1 2 3 4 5 6 7 8 9 10 11 | |
"(?<=^[^#\"'\\n]*)(?:(?:(?:(#(?:#{2})?)(region)()|(#(?:#{2})?)(section)())([ \\t]+)(.+?)([ \\t]*$))|(?:(#(?:#{2})?)(endregion)()([ \\t]+)(.+?)([ \\t]*$)))": { | |
// "^(\\s*)(#+\\s*)(?:([@][\\w]+:?)([ \\t]+))$": { | |
"regexFlags": "gm", | |
"filterLanguageRegex": "properties|shellscript", | |
"decorations": [ | |
// @block #region | |
{ // # | |
// "color": "#B00", | |
// "fontWeight": "600", | |
"opacity": "0.7" | |
}, | |
{ // region | |
"color": "#D00", | |
"fontWeight": "600", | |
"opacity": "1" | |
}, | |
{ // #region Line | |
"isWholeLine": true, | |
"borderColor": "#1188CC18", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
// @block #section | |
{ // # | |
// "color": "#C09", | |
// "fontWeight": "600", | |
"opacity": "0.7" | |
}, | |
{ // section | |
"color": "#C09", | |
"fontWeight": "600", | |
"opacity": "1" | |
}, | |
{ // #section Line | |
"isWholeLine": true, | |
"color": "#C09", | |
"borderColor": "#CC009918", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
{}, | |
// Group • #region Decscription | |
{ | |
"textDecoration": "; box-shadow: 0 0.0625em 0 0 #11AAEE80", | |
"color": "#0099FF", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
}, | |
{}, | |
// Group • {#}, endregion | |
{ | |
"color": "#0099FF", | |
"opacity": "0.4" | |
}, | |
{ | |
"color": "#0099FF", | |
"opacity": "0.4" | |
}, | |
// Group • #endregion Line styling | |
{ | |
"isWholeLine": true, | |
"opacity": "0.5" | |
}, | |
// Group • #endregion Decscription | |
{}, | |
{ | |
"textDecoration": "; box-shadow: 0 0.0625em 0 0 #11AAEE80", | |
"color": "#0099FF", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
}, | |
{}, | |
] | |
}, | |
// Highlight • zsh => Comment tags | |
"^(\\s+)(#+[ ]?)(?:([@]?[\\w]+(?:[:]|(?<=#[ ]?@[\\w]+))))([ \\t]*)$": { | |
// "^(\\s*)(#+\\s*)(?:([@][\\w]+:?)([ \\t]+))$": { | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "shellscript", | |
"decorations": [ | |
{ }, { }, | |
{ | |
"color": "#CC0099", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
} | |
] | |
}, | |
"(-\\w(?=\\W)|--\\w+(?:-\\w+)?)(?<=^(?:\\s*)(?:#+[ ]+).+)": { | |
// "^(\\s*)(#+\\s*)(?:([@][\\w]+:?)([ \\t]+))$": { | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "shellscript", | |
"decorations": [ | |
{ | |
"color": "#AA55AA", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ }, { }, | |
{ | |
"color": "#AA0000", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
} | |
] | |
}, | |
// Highlight • zsh => temp | |
"((?:or|[:,]||^ # +) )('[^']+?')(?<=^(?:\\s*)(?:#+[ ]+)-.+?: .+|^ # +'.+)": { | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "shellscript|zsh|zshell", | |
"decorations": [{ }, | |
{ | |
"color": "#2233AA", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
}, | |
{ }, { }, | |
{ | |
"color": "#AA0000", | |
"fontStyle": "italic", | |
"fontWeight": "700" | |
} | |
] | |
}, | |
// Highlight • zsh => _arguments parameters | |
/** | |
* |—|Entry quote char | |
* |————| isWholeLine decoration | |
* |———| Base match | |
* |——————————————————| Simple case - #!zsh | |
* .../env {shell} |——————————————————————————————————————————————————————| | |
* zsh |———————————————————————————————————————| | |
* | |
* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15*/ | |
"(['\"])(?:([\\(])(.+?)([\\)]))?(-\\w(?=\\W)|--\\w+(?:-\\w+)*)([=\\+]?)(\\[)(.+?)(\\])(?:(?:([:])(.*?:[\\(])?([ ]*[\\(])?|)(.+?)([\\)])?)?(\\1)": { | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "shellscript|zsh|zshell", | |
"decorations": [ | |
{ // Quot | |
"backgroundColor": "#55AA3303", | |
"color": "#88CC9990", | |
"fontStyle": "oblique" | |
}, | |
{ // Filter open paren | |
"backgroundColor": "#55AA3303", | |
"color": "#88CC9990", | |
"fontStyle": "oblique" | |
}, | |
// Filter values | |
{ | |
"backgroundColor": "#55AA3303", | |
"color": "#001199", | |
"fontWeight": "600" | |
}, | |
// End filter paren | |
{ | |
"backgroundColor": "#55AA3303", | |
"color": "#88CC9990", | |
"fontStyle": "oblique" | |
}, | |
// Completion | |
{ | |
"color": "#CC0000", | |
"backgroundColor": "#55AA3303", | |
"fontWeight": "600" | |
}, | |
{ | |
"color": "#00a055", | |
"backgroundColor": "#55AA3303", | |
"fontStyle": "oblique" | |
}, | |
// Begin description ([) | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303", | |
"fontStyle": "oblique" | |
}, | |
// [Description] | |
{ | |
"color": "#116699", | |
"backgroundColor": "#55AA3303", | |
"fontStyle": "oblique", | |
"opacity": "0.8", | |
"fontWeight": "500" | |
}, | |
// End description (]) | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303" | |
}, | |
// Rest | |
{ // First colon | |
"color": "#88AA99", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#3a179b", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#F0F", // "#88CCAA", | |
"backgroundColor": "#55AA3303" | |
}, | |
// Completion options list | |
{ | |
"color": "#b80c67", | |
"backgroundColor": "#55AA3303", | |
"fontWeight": "600" | |
}, | |
{ | |
"color": "#88CCAA", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ // End parens | |
"color": "#88AA99", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#88AA99", | |
"backgroundColor": "#55AA3303" | |
} | |
] | |
}, //(['\"])([=\\+]?)(\\[)(.+?)(\\])(:.+?)?(\\6) | |
"(\\{)(-[\\w]|--[\\w]+(?:-[\\w]+)*)(,)(-[\\w]|--[\\w]+(?:-[\\w]+)*)(\\})(['\"])([=\\+]?)(\\[)(.+?)(\\])(?:(?:(:)(.*?:\\()?([ ]*[\\(])?|)(.+?)(\\))?)?(\\6)": { | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "shellscript|zsh|zshell", | |
"decorations": [ | |
// Begin bracket | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#0077AA", | |
"backgroundColor": "#55AA3303", | |
"fontWeight": "700" | |
}, | |
// Comma | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#0077AA", | |
"backgroundColor": "#55AA3303", | |
"fontWeight": "700" | |
}, | |
// End bracket | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ // Modifier | |
"color": "#AA5577", | |
"backgroundColor": "#55AA3303" | |
}, | |
// Begin description | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#996699", | |
"backgroundColor": "#55AA3303", | |
"fontStyle": "italic" | |
}, | |
// End description | |
{ | |
"color": "#88CC9990", | |
"backgroundColor": "#55AA3303" | |
}, | |
// Rest | |
{ // First colon | |
"color": "#88AA99", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#88AA99", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#88CCAA", | |
"backgroundColor": "#55AA3303" | |
}, | |
// Completion options list | |
{ | |
"color": "#115599E0", | |
"backgroundColor": "#55AA3303", | |
"fontWeight": "600" | |
}, | |
{ | |
"color": "#88CCAA", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ // End parens | |
"color": "#88AA99", | |
"backgroundColor": "#55AA3303" | |
}, | |
{ | |
"color": "#88AA99", | |
"backgroundColor": "#55AA3303" | |
} | |
] | |
}, | |
// Highlight • zsh => always keyword | |
"([\\}][ ]*)(always)([ ]*[\\{])": { | |
"filterLanguageRegex": "(?:shell(?:script)?)", | |
"decorations": [ | |
{ }, | |
{ | |
"color": "#3333FF", | |
"fontWeight": "bold", | |
"textDecoration": "underline #0033FF50" | |
}, | |
{ } | |
] | |
}, | |
// Highlight • zsh => emulate zsh -L | |
"(?<=(?:^|;|[\\(][ ]*[\\)][\\{]|[&]{2}|[\\|]{2}))([ ]+)?(builtin)([ ]+)(emulate)( zsh[ ]*)(?:(?=-[lL])(-L)|(-l))?": { | |
"regexFlags": "gm", | |
"filterLanguageRegex": "(?:shell(?:script)?)", | |
"decorations": [ | |
{ }, | |
{ | |
"fontStyle": "normal", | |
"fontWeight": "600", | |
"color": "#CC0000" | |
}, | |
{ }, | |
{ | |
"fontStyle": "normal", | |
"fontWeight": "600", | |
"color": "#CC0000" | |
}, | |
{ | |
"fontStyle": "oblique", | |
"fontWeight": "600", | |
"color": "#0000AA" | |
}, | |
{ | |
"fontStyle": "oblique", | |
"fontWeight": "600", | |
"color": "#0000EE" | |
}, | |
{ | |
"backgroundColor": "#AA3333", | |
"color": "white" | |
} | |
] | |
}, | |
// Highlight • zsh => Visual effect prompt escapes | |
// // 1 2 3 4 5 6 7 8 9 10 11 | |
// "(?=%[SsBbFfKkUuE%])(?:(?:([%]{2})|(%[fk])|(%[Bb])|(%[Uu])|(%[Ss])|(%E))|(%[FK])([\\{])(?:(\\d+)|([a-z]+))([\\}])?))": { | |
// "filterLanguageRegex": "shellscript", | |
// "regexFlags": "gm", | |
// "decorations": [ | |
// { // 1 Escaped % (%%) | |
// "color": "#55CC00" | |
// }, | |
// { // 2 Foreground / Background Color Reset | |
// "color": "#3300CC", | |
// "fontStyle": "oblique", | |
// "fontWeight": "600", | |
// }, | |
// { // 3 Bold Single | |
// "fontWeight": "700", | |
// "fontStyle": "italic", | |
// "color": "#bf0000" | |
// }, | |
// { // 4 Underline Single Escape | |
// "borderStyle": "none none solid none", | |
// "borderColor": "#0044EEAA", | |
// "borderWidth": "1.5px" | |
// }, | |
// { // 5 %S Inverse | |
// "backgroundColor": "#00A", | |
// "borderRadius": "3px", | |
// "color": "white", | |
// "fontWeight": "600" | |
// }, | |
// { // 6 %E Clear to EOL | |
// "backgroundColor": "#CC0000CC", | |
// "borderRadius": "2px", | |
// "color": "white", | |
// "fontWeight": "600" | |
// }, | |
// { // 7 %{ String literal delimiter | |
// "color": "#3300CC", | |
// "fontStyle": "oblique", | |
// "fontWeight": "600", | |
// }, | |
// { // 8 | |
// "color": "#3300CC", | |
// "fontStyle": "oblique", | |
// "fontWeight": "600", | |
// }, | |
// { // 9 | |
// "color": "#00C", | |
// "fontWeight": "600", | |
// "fontStyle": "oblique" | |
// }, | |
// { // 10 | |
// "color": "#00C", | |
// "fontWeight": "600", | |
// "fontStyle": "oblique" | |
// }, | |
// { // 11 | |
// "color": "#00C", | |
// "fontWeight": "400", | |
// "fontStyle": "oblique" | |
// }, | |
// { // 12 | |
// "color": "#00C", | |
// "fontWeight": "400", | |
// "fontStyle": "oblique" | |
// }, | |
// { // 12 | |
// "color": "#00C" | |
// }, | |
// ] | |
// }, | |
// Highlight • zsh => zinit command and args | |
"[\\b](zinit|zplugin)(?:((?:[ \\t]+|[\\\\][\\n])+)(?:(ice|snippet|load|\\$loader)|(for|lucid)|((?:as|atload|atinit|from|pick|nocompile|atpull|wait)(?:'(?:\\\\'|[^\\\\]+)'|\"(?:\\\\\"|[^\\\\]+)\")?)))": { | |
// "^([ ]*)(zinit|zplugin)(?:([\\t ]+)(?:(load|light)|(\\$loader)|(for)|(ice)|(?:(as)(?:('(?:\\\\'|[^'])+')|(\"(?:\\\\\"|[^\\n\"])+\")))|(?:(snippet)([ ]+)((?:.+)(?=\\s|$)))|(\\\\\\n))|(\\$(?:NULLREPO))|(\\S+))*": { | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "(?:shell(?:script)?)", | |
"decorations":[ | |
// Group • Indent Whitespace | |
{ "outline": "1px red solid "}, | |
// Group • zinit command | |
{ | |
"color": "#0000AA", | |
"fontWeight": "bold", | |
"fontStyle": "italic" | |
}, | |
{ "outline": "1px magenta solid" }, | |
// Group • Pre zinit arg/param Whitespace | |
{ }, | |
// Group • zinit param: `load` | `light` | |
{ // load | |
"color": "#66AA44", | |
"fontWeight": "800", | |
"textDecoration": "italic" | |
}, | |
{ // light | |
"color": "#9DCD44", | |
"fontWeight": "800", | |
"textDecoration": "italic" | |
}, | |
// Group • zinit param: `ice` | |
{ | |
"color": "#0000DD" | |
}, | |
// Group • zinit param: `snippet` | |
{ | |
"color": "#006666" | |
}, | |
// Group • zinit param: `snippet` > Pre-Argument Whitespace | |
{ | |
"color": "#338899", | |
"fontWeight": "800" | |
}, | |
// Group • zinit param: `snippet` > argument | |
{ | |
"color": "#0345FD", | |
"fontWeight": "500", | |
"fontStyle": "italic", | |
"textDecoration": "solid underline" | |
}, | |
// Keep this at bottom | |
// Group • zinit arg: etc | |
{ | |
"border": "2px #99FF9930" | |
}, | |
{ "outline": "1px solid red" },{ "outline": "1px solid #00DDDD" },{ "outline": "2px solid blue" } | |
] | |
}, | |
// Highlight • shellscript => shebang | |
// Metadecoration for below regex | |
"(\\*[ ]+)([ \\w\\.\\/\\\\\\[\\]\\{\\}]*?[ ]?)([\\|](?:[—])*?[\\|])(.*)": { | |
"filterFileRegex": "settings(?:\\.\\w+)?\\.json|\\.code-workspace$", | |
"regexFlags": "gmi", | |
"decorations": [ | |
{}, | |
{ "color": "#00CC44" }, | |
{ "color": "#000088", "fontStyle": "unset"}, | |
{ "color": "#00CC44" } | |
] | |
}, | |
/** | |
* |—————————————| Matches absolute beginning | |
* |——————| isWholeLine decoration | |
* |———| Base match | |
* |——————————————————| Simple case - #!zsh | |
* .../env {shell} |——————————————————————————————————————————————————————| | |
* zsh |———————————————————————————————————————| | |
* Matches 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18*/ | |
"^(?<![\\s\\S\\r])(?:((?=#!))(#!)(?:([a-z_-]+)(\\s*)|(.+?[\\/])(env)([ ]+)([\\w]+)(?:([ ]+)(.+?)|())([ \\t]*))|(#)(?:(autoload)(.*)|(compdef)(.*)))$": { | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "shellscript|zsh|zshell", | |
"decorations": [ | |
// Line style | |
{ | |
"borderStyle": "none none solid none", | |
"borderWidth": ".125em", | |
"borderColor": "#AA000020", | |
"borderRadius": "0.1em", | |
"isWholeLine": true | |
}, | |
// Base Match | |
{ | |
"color": "#AA0000", | |
"opacity": "0.5", | |
"fontWeight": "500" | |
}, | |
// Simple Case | |
{ }, | |
{ }, | |
// .../env {shell} | |
{ // # 5 | |
"color": "#880000", | |
"opacity": "0.5", | |
"fontWeight": "500" | |
}, | |
{ | |
"color": "#CC0000", | |
"opacity": "1", | |
"fontWeight": "600" | |
}, | |
{ }, | |
{ // # 8: PATH command | |
"color": "#0011EE", | |
"fontWeight": "700", | |
"fontStyle": "unset" | |
// "fontStyle": "normal" | |
}, | |
{ }, | |
{ // 10: Args, if any | |
"color": "#CC99AA", | |
"fontStyle": "unset", | |
"fontWeight": "500" | |
}, | |
{ }, { }, | |
// zsh declarations | |
{ // 13: # | |
"color": "#CC0000", | |
"opacity": "1", | |
"fontStyle": "normal", | |
"fontWeight": "500", | |
"borderStyle": "none none solid none", | |
"borderWidth": ".125em", | |
"borderColor": "#AA000020", | |
"borderRadius": "0.1em" | |
}, | |
{ // 14: autoload | |
"color": "#CC0000", | |
"opacity": "1", | |
"fontStyle": "normal", | |
"fontWeight": "500", | |
"borderStyle": "none none solid none", | |
"borderWidth": ".125em", | |
"borderColor": "#AA000020", | |
"borderRadius": "0.1em" | |
}, | |
{ // 15: rest | |
"color": "#CC0000", | |
"opacity": "0.8", | |
"fontStyle": "oblique", | |
"fontWeight": "600" | |
}, | |
{ // 16: compdef | |
"color": "#CC0000", | |
"opacity": "1", | |
"fontStyle": "normal", | |
"fontWeight": "500", | |
"borderStyle": "none none solid none", | |
"borderWidth": ".125em", | |
"borderColor": "#AA000020", | |
"borderRadius": "0.1em" | |
}, | |
{ // 17: rest | |
"color": "#CC0000", | |
"opacity": "0.8", | |
"fontStyle": "oblique", | |
"fontWeight": "600" | |
} | |
] | |
}, | |
// Highlight • xml | tmLanguage => XML Escape Chars | |
"(?:(?:(&)|(<)|(>)|(")|('))(?=[^><]*</))": { | |
"filterLanguageRegex": "xml|tmLanguage", | |
"regexFlags": "gm", | |
"decorations": [ | |
{ "textDecoration": "; box-shadow: 0 2px 0 0 #00883380" }, | |
{ "textDecoration": "; box-shadow: 0 2px 0 0 #AA006680" }, | |
{ "textDecoration": "; box-shadow: 0 2px 0 0 #AA006680" }, | |
{ "textDecoration": "; box-shadow: 0 2px 0 0 0033FF80" }, | |
{ "textDecoration": "; box-shadow: 0 2px 0 0 #2266EE80" } | |
] | |
}, | |
// Highlight • Stylus => Region Comments | |
// // 1 2 3 4 5 6 7 8 9 10 11 | |
// "^([ \\t]*)([\\/]{2} ?)(?:()(#)(region)(:)?|(#)(endregion)(:)?)([ \\t]+)(.+?)([ \\t]*)$": { | |
// "filterLanguageRegex": "stylus", | |
// "regexFlags": "gmi", | |
// "decorations": [ | |
// // Group • Indent, Comment Token, Whitespace | |
// { }, | |
// { }, | |
// // Group • #region Line formatting | |
// { | |
// "isWholeLine": true, | |
// "borderColor": "#1188CC18", | |
// "borderStyle": "solid", | |
// "borderWidth": "0 0 0.0625em 0" | |
// }, | |
// // Group • #region | |
// { | |
// "before": { | |
// "color": "hsla(215, 100%, 90%, 1)" | |
// } | |
// //"color": "hsla(215, 100%, 60%, 1)", // "hsla(210, 100%, 70%, 1)", | |
// // "backgroundColor": "hsla(250, 90%, 40%, 1)", | |
// // "color": "hsla(215, 100%, 90%, 1)" | |
// }, | |
// {}, {}, {}, {}, {}, {}, | |
// // Group • Description | |
// { | |
// "textDecoration": "; box-shadow: 0 0px 0 hsla(219, 100%, 30%, 0), 0px 2px 0px hsla(210, 100%, 70%, 1);", | |
// "#after":{ | |
// "contentText": "🢇", | |
// "fontSize": "17px", | |
// "backgroundColor": "hsla(250, 90%, 40%, 1)", | |
// "textDecoration": "; left: 0.14em ; width: 20px; height: 20px; padding: 0.1em 0.3em 0.1em 0.22em; margin: 0.4em; border-radius: 0.4em; position: relative; top: -0.2em; z-index: 10000;", | |
// "color": "#EDEDED"//"hsla(290, 90%, 70%, 1)" | |
// } | |
// }, | |
// // Group • Whitespace | |
// { } | |
// ] | |
// }, | |
// Modified from shellscript {end,}region|section highlighter | |
"(?<=^[^#\"'\\n]*)(?:(?:(?:([\\/]{2}[ ]?#)(region)()|([\\/]{2}[ ]?#)(section)())([ \\t]+)(.+?)([ \\t]*$))|(?:([\\/]{2}[ ]?#)(endregion)()([ \\t]+)(.+?)([ \\t]*$)))": { | |
"regexFlags": "gm", | |
"filterLanguageRegex": "stylus", | |
"decorations": [ | |
// @block #region | |
{ // # | |
"color": "#C00", | |
"opacity": "0.7", | |
"fontStyle": "unset" | |
}, | |
{ // region | |
"color": "#C00", | |
"fontWeight": "600", | |
"opacity": "1", | |
"fontStyle": "unset" | |
}, | |
{ // #region Line | |
"isWholeLine": true, | |
"borderColor": "#1188CC18", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
// @block #section | |
{ // # | |
"opacity": "0.7" | |
}, | |
{ // section | |
"color": "#C09", | |
"fontWeight": "600", | |
"opacity": "1" | |
}, | |
{ // #section Line | |
"isWholeLine": true, | |
"color": "#C09", | |
"borderColor": "#CC009918", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
{}, | |
// Group • #region Decscription | |
{ | |
"textDecoration": "; box-shadow: 0 0.0625em 0 0 #1188CC80", | |
"color": "#1188CC", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
}, | |
{}, | |
// Group • {#}, endregion | |
{ | |
"color": "#1188CC", | |
"opacity": "0.4" | |
}, | |
{ | |
"color": "#1188CC", | |
"opacity": "0.4" | |
}, | |
// Group • #endregion Line styling | |
{ | |
"isWholeLine": true, | |
"opacity": "0.5" | |
}, | |
// Group • #endregion Decscription | |
{}, | |
{ | |
"textDecoration": "; box-shadow: 0 0.0625em 0 0 #11AAEE80", | |
"color": "#0099FF", | |
"fontStyle": "italic", | |
"fontWeight": "600" | |
}, | |
{}, | |
] | |
}, | |
// Highlight • Micro => Colorscheme file syntax | |
// "^([ ]*)(color-link)([ ]+)([\\w-]+(?:[\\.][\\w-]+)*)([ ]+)(\")(?:(?:(bold(?:(?=\")| ))|(?:(bold(?:(?=\")| ))))(.+\"))$": { | |
// 1 2 3 4 5 6 7 8 9 | |
"^(?:([ \\t]*)([#][ ]*)(?:([@][\\w\\d_-]+)(.*)|(.*))$|([ \\t]*)(color-link)([ \\t]+)(\\S+?\\.)?(\\S+))": { // ([ \\t]+)([\"][^\"]+[\"]))": { | |
"filterFileRegex": ".*\\.micro", | |
"regexFlags": "gm", | |
"decorations": [ | |
{ }, | |
{ "color": "#888" }, | |
{ "color": "#b3316d", "fontStyle": "oblique", "fontWeight": "600" }, | |
{ "color": "#888888" }, | |
{ "color": "#888888" }, | |
{ "color": "#888888" }, | |
{ },{ }, | |
{ | |
"color": "#0000AA" | |
}, | |
{ | |
"color": "#ac002b" | |
}, | |
{ | |
"color": "#0000CC" | |
}, | |
{ | |
"color": "#0000CC" | |
}, | |
{ | |
"fontWeight": "800" | |
} | |
] | |
}, | |
// Highlight • Micro Syntax => Quoted Regexp Escapes | |
"(?<=^[^']+['].*)(?:([\\\\])([\\/])|([\\\\])([\\*\\?\\$\\^]))": { | |
"filterFileRegex": "\\.yaml$", | |
"regexFlags": "gmi", | |
"decorations": [ | |
{ // > \\s | |
"color": "#800", | |
// "borderWidth": "dashed 0.75px #27c8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ // > \\s \\S \ | |
"color": "#800", | |
// "border": "dashed 0.75px #27c8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ // > \\n \\b \\B \d | |
"color": "#11BB00", | |
"opacity": "0.7", | |
// "border": "dashed 0.75px #71A8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ // > \\n \\b \\B \\d | |
"color": "#11BB00", | |
// "border": "0.75px #71A8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ // > \\} \\{ \\) \\( \\[ \\] | |
"color": "#4444EE", | |
// "color": "#3db1ff", | |
"opacity": "0.325" | |
}, | |
{ // > \\} \\{ \\) \\( \\[ \\] | |
"color": "#0057bb", | |
"opacity": "0.7", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ // > \\} \\{ \\) \\( \\[ \\] | |
"color": "#0000BB", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ // > \\* \\^ \\? | |
"color": "#D51015", | |
// "color": "#3db1ff", | |
"opacity": "0.3" | |
}, | |
{ // > \\* \\^ \\? \\1 \\2 | |
// "color": "#31e249", | |
"color": "#D51015", | |
"opacity": "0.8", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ // > \\* \\^ \\? | |
"color": "#D51015", | |
// "border": "dashed 0.75px #09C8", | |
// "borderStyle": "none none dashed none", | |
"fontWeight": "600" | |
}, | |
{ | |
"color": "#0F02" | |
}, | |
{ | |
"color": "#0F0", | |
"textDecoration": "; box-shadow: 0 0.06125em 0 0 ", | |
"fontWeight": "700" }, | |
{ | |
"color": "#0AA2" | |
}, | |
{ | |
"color": "#0AA", | |
"textDecoration": "; box-shadow: 0 0.06125em 0 0 ", | |
"fontWeight": "700" }, | |
{ | |
"backgroundColor": "#F00" | |
} | |
] | |
}, | |
// Highlight • Powershell => Region comments | |
// 1 2 3 4 5 6 7 8 9 10 | |
"^([ \\t]*)(?:()(#)(region)|()(#)(endregion))([ ]+)(.+?)([ \\t]*)$": { | |
"filterLanguageRegex": "powershell", | |
"regexFlags": "gmi", | |
"decorations": [ | |
// Group • Beginning whitespace | |
{ }, | |
// Group • #region Line styling | |
{ | |
"isWholeLine": true, | |
"borderColor": "#1188CC18", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
// Group • #|region | |
{ | |
"color": "#AA0000", | |
"opacity": "0.5", | |
"fontWeight": "600" | |
}, | |
{ | |
"color": "#AA0000", | |
"opacity": "0.5", | |
"fontWeight": "600" | |
}, | |
// Group • #endregion Line styling | |
{ | |
"isWholeLine": true, | |
"opacity": "0.5", | |
"color": "#AA0000" | |
}, | |
// Group • #|endregion | |
{ }, { }, | |
// Group • Space separator, Region description | |
{ | |
}, | |
{ | |
"color": "#CC0000", | |
"opacity": "0.8", | |
"fontWeight": "600" | |
}, | |
// Group • Ending whitespace | |
{ } | |
] | |
}, | |
// "([\\(][\\?][#][ ]?)(.+?)((?<![\\\\])[\\)])": { | |
// "filterLanguageRegex": "powershell", | |
// "regexFlags": "gmi", | |
// "decorations": [ | |
// { "color": "#408CFF", "backgroundColor": "#408CFF10", "opacity": "0.5", "fontStyle": "oblique" }, | |
// { "color": "#4055AA", "backgroundColor": "#408CFF10", "opacity": "1", "fontStyle": "oblique", "fontWeight": "600" }, | |
// { "color": "#408CFF", "backgroundColor": "#408CFF10", "opacity": "0.5", "fontStyle": "oblique" }, | |
// { "color": "#408CFF", "backgroundColor": "#408CFF10", "opacity": "0.5", "fontStyle": "oblique" } | |
// ] | |
// }, | |
// 1 2 3 | |
"(?<=^[ \\t]+)([#]{3}[ ])(.+?)([ \\t]*$)": { | |
"filterLanguageRegex": "powershell", | |
"regexFlags": "gmi", | |
"decorations": [ | |
// Group • ###{Space} | |
{ | |
"isWholeLine": true, | |
"color": "#2288AA", | |
"fontStyle": "oblique", | |
"fontWeight": "600" | |
}, | |
// Group • Description | |
{ | |
"borderWidth": "0px 0px 2px 0px", | |
"borderStyle": "none none solid none", | |
// "borderRadius": "5px 20px / 2px 3px", | |
"borderColor": "#2288AA40" | |
}, | |
{ | |
// "color": "#AA0000", | |
// "opacity": "0.5", | |
// "fontWeight": "600" | |
} | |
] | |
}, | |
// Highlight • Project Manager Extension => $home variable | |
"([\\$]home(?=$|\\b))": { | |
"regexFlags": "gm", | |
"filterFileRegex": "(settings|projects)\\.json|\\.code-workspace", | |
"decorations": [{ | |
"rangeBehavior": 1, | |
"color": "#004cff", | |
"fontWeight": "600", | |
"fontStyle": "oblique" | |
}] | |
}, | |
// Highlight • gcode => Cura Annotations | |
"(?:^(?:(;()(?:LAYER|MESH):)(.*)|(;()TYPE:)(.+)|(;M(?:AX|IN)[XYZ]:)(.+))$)": { | |
"filterLanguageRegex": "gcode", | |
"regexFlags": "gm", | |
"decorations": [ | |
{ | |
"color": "#AA0000", | |
"fontWeight": "600" | |
}, | |
{ | |
"isWholeLine": true, | |
"overviewRulerLane": "left", | |
"overviewRulerColor": "#AA0000", | |
"fontWeight": "700", | |
// "color": "#AA0000", | |
"backgroundColor": "#AA000020", | |
"borderColor": "#AA000020", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
{ | |
"color": "#AA0000" | |
}, | |
{ | |
"color": "#0044CC", | |
"fontWeight": "600" | |
}, | |
{ | |
"isWholeLine": true, | |
"overviewRulerLane": "center", | |
"fontWeight": "700", | |
// "color": "#0044AA", | |
"backgroundColor": "#0044CC20", | |
"overviewRulerColor": "#0044CC", | |
"borderColor": "#0044CC20", | |
"borderStyle": "solid", | |
"borderWidth": "0 0 0.0625em 0" | |
}, | |
{ | |
"color": "#0044CC" | |
}, | |
{ | |
"color": "#007755", | |
"fontWeight": "700" | |
}, | |
{ | |
"color": "#007755" | |
}, | |
], | |
}, | |
// Highlight • tasks.json => ${variables}, Command Variable Extension | |
"([\\$][\\{])([^\\}\\s]+?)([\\}])": { | |
"filterFileRegex": "(configuration|tasks)\\.json", | |
"regexFlags": "gmi", | |
"filterLanguageRegex": "jsonc?", | |
"decorations": [ | |
{ | |
"color": "#C02", | |
"opacity": "0.7", | |
"fontStyle": "oblique" | |
}, | |
{ | |
"color": "#C02", | |
"fontWeight": "600", | |
"fontStyle": "oblique" | |
}, | |
{ | |
"color": "#C02", | |
"opacity": "0.7", | |
"fontStyle": "oblique" | |
}, | |
] | |
} | |
// Highlight • End | |
}, | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment