Skip to content

Instantly share code, notes, and snippets.

@Krutoy242
Created December 26, 2021 12:32
Show Gist options
  • Save Krutoy242/a76b1bc64bdcbcee0c00660dd04b566e to your computer and use it in GitHub Desktop.
Save Krutoy242/a76b1bc64bdcbcee0c00660dd04b566e to your computer and use it in GitHub Desktop.
VSCode "Highlight" extension settings for Minecraft Color Codes for `.lang` and `.zs` files
{
"highlight.regexes": {
// For .lang files
"(§0)(.+?)(§[^lmno0]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#000000"}, {}]},
"(§1)(.+?)(§[^lmno1]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#0000AA"}, {}]},
"(§2)(.+?)(§[^lmno2]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#00AA00"}, {}]},
"(§3)(.+?)(§[^lmno3]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#00AAAA"}, {}]},
"(§4)(.+?)(§[^lmno4]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#AA0000"}, {}]},
"(§5)(.+?)(§[^lmno5]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#AA00AA"}, {}]},
"(§6)(.+?)(§[^lmno6]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#FFAA00"}, {}]},
"(§7)(.+?)(§[^lmno7]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#AAAAAA"}, {}]},
"(§8)(.+?)(§[^lmno8]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#555555"}, {}]},
"(§9)(.+?)(§[^lmno9]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#5555FF"}, {}]},
"(§a)(.+?)(§[^lmnoa]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#55FF55"}, {}]},
"(§b)(.+?)(§[^lmnob]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#55FFFF"}, {}]},
"(§c)(.+?)(§[^lmnoc]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#FF5555"}, {}]},
"(§d)(.+?)(§[^lmnod]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#FF55FF"}, {}]},
"(§e)(.+?)(§[^lmnoe]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#FFFF55"}, {}]},
"(§f)(.+?)(§[^lmnof]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#FFFFFF"}, {}]},
"(§g)(.+?)(§[^lmnog]|\n|$)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"color": "#DDD605"}, {}]},
"(§l)([^§\n]+)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"fontWeight": "bold"}]},
"(§m)([^§\n]+)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"textDecoration": "line-through"}]},
"(§n)([^§\n]+)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"textDecoration": "Underline"}]},
"(§o)([^§\n]+)": { "filterFileRegex": ".*\\.lang", "decorations": [{}, {"fontStyle": "Italic"}]},
// For .zs files
"(§0)(.+?)(§[^lmno0]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#000000"}, {}]},
"(§1)(.+?)(§[^lmno1]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#0000AA"}, {}]},
"(§2)(.+?)(§[^lmno2]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#00AA00"}, {}]},
"(§3)(.+?)(§[^lmno3]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#00AAAA"}, {}]},
"(§4)(.+?)(§[^lmno4]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#AA0000"}, {}]},
"(§5)(.+?)(§[^lmno5]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#AA00AA"}, {}]},
"(§6)(.+?)(§[^lmno6]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#FFAA00"}, {}]},
"(§7)(.+?)(§[^lmno7]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#AAAAAA"}, {}]},
"(§8)(.+?)(§[^lmno8]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#555555"}, {}]},
"(§9)(.+?)(§[^lmno9]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#5555FF"}, {}]},
"(§a)(.+?)(§[^lmnoa]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#55FF55"}, {}]},
"(§b)(.+?)(§[^lmnob]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#55FFFF"}, {}]},
"(§c)(.+?)(§[^lmnoc]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#FF5555"}, {}]},
"(§d)(.+?)(§[^lmnod]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#FF55FF"}, {}]},
"(§e)(.+?)(§[^lmnoe]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#FFFF55"}, {}]},
"(§f)(.+?)(§[^lmnof]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#FFFFFF"}, {}]},
"(§g)(.+?)(§[^lmnog]|\n|$|\")": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"color": "#DDD605"}, {}]},
"(§l)([^§\n\"]+)": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"fontWeight": "bold"}]},
"(§m)([^§\n\"]+)": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"textDecoration": "line-through"}]},
"(§n)([^§\n\"]+)": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"textDecoration": "Underline"}]},
"(§o)([^§\n\"]+)": { "filterFileRegex": ".*\\.zs", "decorations": [{}, {"fontStyle": "Italic"}]}
}
}
@ChromaPIE
Copy link

Have no idea why but the highlighting color isn't applying for §a, §3 and §6 ;(

@Krutoy242
Copy link
Author

Just checked - works for me.

You could try use another values for color in settings i guess. Or try to remove some lines of settings and see whats happen.

@ChromaPIE
Copy link

ChromaPIE commented Dec 29, 2021

Not working. I tried deleting other lines and changing the color but the colors are still not applying, however it's pretty weird that I just tried replacing §3 with a random letter say §p, the color successfully applied. Sorry for bothering, I might have to troubleshoot that myself.

Sorry for all that. I was all new to Highlight extension and I left highlight.maxMatches at its default value, plus the lang I've been working on was massive, leading to what I thought was a bug or something. Anyways thanks for the neat setting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment