duat_filetype/
lib.rs

1#![feature(decl_macro)]
2use std::{collections::HashMap, path::PathBuf, sync::LazyLock};
3
4use duat_core::prelude::*;
5use regex::RegexSet;
6
7pub trait FileType {
8    fn filetype(&self) -> Option<&'static str>;
9}
10
11impl<U: duat_core::ui::Ui> FileType for duat_core::file::File<U> {
12    fn filetype(&self) -> Option<&'static str> {
13        let path = PathBuf::from(self.path_set()?);
14
15        path.extension()
16            .and_then(|ext| EXTENSIONS.get(ext.to_str()?).copied())
17            .or_else(|| FILENAMES.get(path.to_str()?).copied())
18            .or_else(|| FILENAMES.get(path.file_name()?.to_str()?).copied())
19            .or_else(|| {
20                let (patterns, langs) = &*PATTERNS;
21
22                langs
23                    .get(patterns.matches(path.to_str()?).iter().min()?)
24                    .copied()
25            })
26    }
27}
28
29pub trait HandleFileType {
30    fn filetype(&self, pa: &Pass) -> Option<&'static str>;
31}
32
33impl<U: Ui> HandleFileType for Handle<File<U>, U> {
34    fn filetype(&self, pa: &Pass) -> Option<&'static str> {
35        self.read(pa, |file, _| file.filetype())
36    }
37}
38
39impl<U: Ui> HandleFileType for FileHandle<U> {
40    fn filetype(&self, pa: &Pass) -> Option<&'static str> {
41        self.read(pa, |file, _| file.filetype())
42    }
43}
44
45static EXTENSIONS: LazyLock<HashMap<&'static str, &'static str>> = LazyLock::new(|| {
46    HashMap::from_iter([
47        ("8th", "8th"),
48        ("a65", "a65"),
49        ("aap", "aap"),
50        ("abap", "abap"),
51        ("abc", "abc"),
52        ("abl", "abel"),
53        ("abnf", "abnf"),
54        ("wrm", "acedb"),
55        ("ads", "ada"),
56        ("ada", "ada"),
57        ("gpr", "ada"),
58        ("adb", "ada"),
59        ("tdf", "ahdl"),
60        ("aidl", "aidl"),
61        ("aml", "aml"),
62        ("run", "ampl"),
63        ("g4", "antlr4"),
64        ("scpt", "applescript"),
65        ("ino", "arduino"),
66        ("pde", "arduino"),
67        ("art", "art"),
68        ("asciidoc", "asciidoc"),
69        ("adoc", "asciidoc"),
70        ("asa", "aspvbs"),
71        // TODO: implement detection of other asm syntax
72        ("asm", "asm"),
73        ("s", "asm"),
74        ("S", "asm"),
75        ("a", "asm"),
76        ("A", "asm"),
77        ("lst", "asm"),
78        ("mac", "asm"),
79        ("asn1", "asn"),
80        ("asn", "asn"),
81        // TODO: implement detection of Active Server Pages
82        ("asp", "aspvbs"),
83        ("astro", "astro"),
84        ("asy", "asy"),
85        ("atl", "atlas"),
86        ("as", "atlas"),
87        ("zed", "authzed"),
88        ("ahk", "autohotkey"),
89        ("au3", "autoit"),
90        ("ave", "ave"),
91        ("gawk", "awk"),
92        ("awk", "awk"),
93        ("ref", "b"),
94        ("imp", "b"),
95        ("mch", "b"),
96        // TODO: implement detection of basic (for WHOM???)
97        ("bas", "basic"),
98        ("bass", "bass"),
99        ("bi", "basic"),
100        ("bm", "basic"),
101        ("bc", "bc"),
102        ("bdf", "bdf"),
103        ("beancount", "beancount"),
104        ("bib", "bib"),
105        // TODO: bindzone detection or wtv
106        ("com", "dcl"),
107        ("db", "bindzone"),
108        ("bicep", "bicep"),
109        ("bicepparam", "bicep"),
110        ("zone", "bindzone"),
111        ("bb", "bitbake"),
112        ("bbappend", "bitbake"),
113        ("bbclass", "bitbake"),
114        ("bl", "blank"),
115        ("blp", "blueprint"),
116        ("bp", "bp"),
117        ("bsd", "bsdl"),
118        ("bsdl", "bsdl"),
119        ("bst", "bst"),
120        // TODO: dosbatch detection
121        ("btm", "btm"),
122        ("bzl", "bzl"),
123        ("bazel", "bzl"),
124        ("BUILD", "bzl"),
125        ("mdh", "c"),
126        ("epro", "c"),
127        ("qc", "c"),
128        ("c3", "c3"),
129        ("c3i", "c3"),
130        ("c3t", "c3"),
131        ("cabal", "cabal"),
132        ("cairo", "cairo"),
133        ("capnp", "capnp"),
134        ("cdc", "cdc"),
135        ("cdl", "cdl"),
136        // TODO: Biased for tex, ngl
137        ("toc", "tex"),
138        ("cedar", "cedar"),
139        ("cfc", "cf"),
140        ("cfm", "cf"),
141        ("cfi", "cf"),
142        ("hgrc", "cfg"),
143        // TODO: Other meanings for cfg, i guess
144        ("cfg", "cfg"),
145        ("Cfg", "cfg"),
146        ("CFG", "cfg"),
147        ("chf", "ch"),
148        ("chai", "chaiscript"),
149        // TODO: change, ch, et. all
150        ("ch", "chill"),
151        ("chs", "chaskell"),
152        ("chatito", "chatito"),
153        ("chopro", "chordpro"),
154        ("crd", "chordpro"),
155        ("crdpro", "chordpro"),
156        ("cho", "chordpro"),
157        ("chordpro", "chordpro"),
158        ("ck", "chuck"),
159        // TODO: detect opencl
160        ("cl", "lisp"),
161        ("eni", "cl"),
162        ("icl", "clean"),
163        ("cljx", "clojure"),
164        ("clj", "clojure"),
165        ("cljc", "clojure"),
166        ("cljs", "clojure"),
167        ("cook", "cook"),
168        ("cmake", "cmake"),
169        ("cmod", "cmod"),
170        ("cob", "cobol"),
171        ("cbl", "cobol"),
172        ("atg", "coco"),
173        ("recipe", "conaryrecipe"),
174        ("ctags", "conf"),
175        // TODO: nil-ing, i guess?
176        ("hook", "confini"),
177        ("nmconnection", "confini"),
178        ("mklx", "context"),
179        ("mkiv", "context"),
180        ("mkii", "context"),
181        ("mkxl", "context"),
182        ("mkvi", "context"),
183        // TODO: nil-ing, i guess?
184        ("control", "debcontrol"),
185        // TODO: nil-ing, i guess?
186        ("copyright", "debcopyright"),
187        ("corn", "corn"),
188        // TODO: other types of csh
189        ("csh", "csh"),
190        ("cpon", "cpon"),
191        ("moc", "cpp"),
192        ("hh", "cpp"),
193        ("tlh", "cpp"),
194        ("inl", "cpp"),
195        ("ipp", "cpp"),
196        ("c++", "cpp"),
197        ("C", "cpp"),
198        ("cxx", "cpp"),
199        ("H", "cpp"),
200        ("tcc", "cpp"),
201        ("hxx", "cpp"),
202        ("hpp", "cpp"),
203        ("ixx", "cpp"),
204        ("mpp", "cpp"),
205        ("ccm", "cpp"),
206        ("cppm", "cpp"),
207        ("cxxm", "cpp"),
208        ("c++m", "cpp"),
209        // TODO: Whatever the hell is cynlib
210        ("cpp", "cpp"),
211        ("cc", "cpp"),
212        ("cql", "cqlang"),
213        ("crm", "crm"),
214        ("cr", "crystal"),
215        ("cake", "cs"),
216        ("csx", "cs"),
217        ("cs", "cs"),
218        ("csc", "csc"),
219        ("csdl", "csdl"),
220        ("cshtml", "html"),
221        ("fdr", "csp"),
222        ("csp", "csp"),
223        ("css", "css"),
224        ("csv", "csv"),
225        ("con", "cterm"),
226        ("feature", "cucumber"),
227        ("cuh", "cuda"),
228        ("cu", "cuda"),
229        ("cue", "cue"),
230        ("pld", "cupl"),
231        ("si", "cuplsim"),
232        ("cyn", "cynpp"),
233        ("cypher", "cypher"),
234        ("dfy", "dafny"),
235        ("dart", "dart"),
236        ("drt", "dart"),
237        ("ds", "datascript"),
238        // TODO: Idek what the main one is tbh
239        ("dat", "upstreamdat"),
240        ("Dat", "upstreamdat"),
241        ("DAT", "upstreamdat"),
242        ("dax", "dax"),
243        ("dcd", "dcd"),
244        // TODO: nil-ing i guess?
245        ("decl", "sgmldecl"),
246        ("dec", "sgmldecl"),
247        // TODO: Possibly decl
248        ("dcl", "clean"),
249        // TODO: Could be tex
250        ("def", "def"),
251        ("desc", "desc"),
252        ("directory", "desktop"),
253        ("desktop", "desktop"),
254        ("dhall", "dhall"),
255        ("diff", "diff"),
256        ("rej", "diff"),
257        ("Dockerfile", "dockerfile"),
258        ("dockerfile", "dockerfile"),
259        ("bat", "dosbatch"),
260        ("wrap", "dosini"),
261        ("ini", "dosini"),
262        ("INI", "dosini"),
263        ("vbp", "dosini"),
264        ("dot", "dot"),
265        ("gv", "dot"),
266        ("drac", "dracula"),
267        ("drc", "dracula"),
268        ("lvs", "dracula"),
269        ("lpe", "dracula"),
270        // TODO: Could be faust
271        ("dsp", "make"),
272        ("dtd", "dtd"),
273        // TODO: Could be dtrace
274        ("d", "d"),
275        ("dts", "dts"),
276        ("dtsi", "dts"),
277        ("dtso", "dts"),
278        ("its", "dts"),
279        ("keymap", "dts"),
280        ("overlay", "dts"),
281        ("dylan", "dylan"),
282        ("intr", "dylanintr"),
283        ("lid", "dylanlid"),
284        // TODO: could be specman
285        ("e", "eiffel"),
286        ("E", "eiffel"),
287        ("ecd", "ecd"),
288        ("edf", "edif"),
289        ("edif", "edif"),
290        ("edo", "edif"),
291        // TODO: could be edif
292        ("edn", "closure"),
293        ("eex", "eelixir"),
294        ("leex", "eelixir"),
295        ("am", "elf"),
296        ("exs", "elixir"),
297        ("elm", "elm"),
298        ("lc", "elsa"),
299        ("elv", "elvish"),
300        // TODO: could be cl
301        ("ent", "dtd"),
302        ("epp", "epuppet"),
303        ("erl", "erlang"),
304        ("hrl", "erlang"),
305        ("yaws", "erlang"),
306        ("erb", "eruby"),
307        ("rhtml", "eruby"),
308        ("esdl", "esdl"),
309        ("ec", "esqlc"),
310        ("EC", "esqlc"),
311        ("strl", "esterel"),
312        // TODO: detect other euphorias
313        ("eu", "euphoria3"),
314        ("EU", "euphoria3"),
315        ("ew", "euphoria3"),
316        ("EW", "euphoria3"),
317        ("EX", "euphoria3"),
318        ("exu", "euphoria3"),
319        ("EXU", "euphoria3"),
320        ("exw", "euphoria3"),
321        ("EXW", "euphoria3"),
322        // TODO: could be euphoria
323        ("ex", "elixir"),
324        ("exp", "expect"),
325        // TODO: could be forth
326        ("f", "fortran"),
327        ("factor", "factor"),
328        ("fal", "falcon"),
329        ("fan", "fan"),
330        ("fwt", "fan"),
331        ("lib", "faust"),
332        ("fnl", "fennel"),
333        ("m4gl", "fgl"),
334        ("4gl", "fgl"),
335        ("4gh", "fgl"),
336        ("fir", "firrtl"),
337        ("fish", "fish"),
338        ("focexec", "focexec"),
339        ("fex", "focexec"),
340        ("ft", "forth"),
341        ("fth", "forth"),
342        ("4th", "forth"),
343        ("FOR", "fortran"),
344        ("f77", "fortran"),
345        ("f03", "fortran"),
346        ("fortran", "fortran"),
347        ("F95", "fortran"),
348        ("f90", "fortran"),
349        ("F03", "fortran"),
350        ("fpp", "fortran"),
351        ("FTN", "fortran"),
352        ("ftn", "fortran"),
353        ("for", "fortran"),
354        ("F90", "fortran"),
355        ("F77", "fortran"),
356        ("f95", "fortran"),
357        ("FPP", "fortran"),
358        ("F", "fortran"),
359        ("F08", "fortran"),
360        ("f08", "fortran"),
361        ("fpc", "fpcmake"),
362        ("fsl", "framescript"),
363        // TODO: could be vb
364        ("frm", "form"),
365        ("fb", "freebasic"),
366        ("fs", "fortran"),
367        ("fsh", "fsh"),
368        ("fsi", "fsharp"),
369        ("fsx", "fsharp"),
370        ("fc", "func"),
371        ("fusion", "fusion"),
372        ("gdb", "gdb"),
373        ("gdmo", "gdmo"),
374        ("mo", "gdmo"),
375        ("tscn", "gdresource"),
376        ("tres", "gdresource"),
377        ("gd", "gdscript"),
378        ("gdshader", "gdshader"),
379        ("shader", "gdshader"),
380        ("ged", "gedcom"),
381        ("gel", "gel"),
382        ("gmi", "gemtext"),
383        ("gemini", "gemtext"),
384        ("gift", "gift"),
385        ("prettierignore", "gitignore"),
386        ("gleam", "gleam"),
387        ("vert", "glsl"),
388        ("tesc", "glsl"),
389        ("tese", "glsl"),
390        ("glsl", "glsl"),
391        ("geom", "glsl"),
392        ("frag", "glsl"),
393        ("comp", "glsl"),
394        ("rgen", "glsl"),
395        ("rmiss", "glsl"),
396        ("rchit", "glsl"),
397        ("rahit", "glsl"),
398        ("rint", "glsl"),
399        ("rcall", "glsl"),
400        ("gn", "gn"),
401        ("gni", "gn"),
402        ("gnuplot", "gnuplot"),
403        ("gpi", "gnuplot"),
404        ("go", "go"),
405        ("gp", "gp"),
406        ("gs", "grads"),
407        ("gql", "graphql"),
408        ("graphql", "graphql"),
409        ("graphqls", "graphql"),
410        ("gretl", "gretl"),
411        ("gradle", "groovy"),
412        ("groovy", "groovy"),
413        ("gsp", "gsp"),
414        ("gjs", "javascript.glimmer"),
415        ("gts", "typescript.glimmer"),
416        ("gyp", "gyp"),
417        ("gypi", "gyp"),
418        ("hack", "hack"),
419        ("hackpartial", "hack"),
420        ("haml", "haml"),
421        ("hsm", "hamster"),
422        ("hbs", "handlebars"),
423        ("ha", "hare"),
424        ("hs-boot", "haskell"),
425        ("hsig", "haskell"),
426        ("hsc", "haskell"),
427        ("hs", "haskell"),
428        ("persistentmodels", "haskellpersistent"),
429        ("ht", "haste"),
430        ("htpp", "hastepreproc"),
431        ("hcl", "hcl"),
432        ("hb", "hb"),
433        // TODO: could be various other c clones
434        ("h", "c"),
435        ("sum", "hercules"),
436        ("errsum", "hercules"),
437        ("ev", "hercules"),
438        ("vc", "hercules"),
439        ("heex", "heex"),
440        ("hex", "hex"),
441        ("a43", "hex"),
442        ("a90", "hex"),
443        ("h32", "hex"),
444        ("h80", "hex"),
445        ("h86", "hex"),
446        ("ihex", "hex"),
447        ("ihe", "hex"),
448        ("ihx", "hex"),
449        ("int", "hex"),
450        ("mcs", "hex"),
451        ("hjson", "hjson"),
452        ("m3u", "hlsplaylist"),
453        ("m3u8", "hlsplaylist"),
454        ("hog", "hog"),
455        ("hws", "hollywood"),
456        ("hoon", "hoon"),
457        // TODO: could be other flavors of html
458        ("cpt", "html"),
459        ("dtml", "html"),
460        ("htm", "html"),
461        ("html", "html"),
462        ("pt", "html"),
463        ("shtml", "html"),
464        ("stm", "html"),
465        ("htt", "httest"),
466        ("htb", "httest"),
467        ("http", "http"),
468        ("hurl", "hurl"),
469        // TODO: could be whatever the hell is virata
470        ("hw", "php"),
471        ("module", "php"),
472        ("pkg", "php"),
473        ("hy", "hy"),
474        ("iba", "ibasic"),
475        ("ibi", "ibasic"),
476        ("icn", "icon"),
477        // TODO: could be msidl
478        ("idl", "idl"),
479        ("idr", "idris2"),
480        // TODO: could be many things
481        ("inc", "php"),
482        ("inf", "inform"),
483        ("INF", "inform"),
484        ("ii", "initng"),
485        ("inko", "inko"),
486        // TODO: could be other things
487        ("inp", "tex"),
488        // TODO: could be xmath
489        ("ms", "nroff"),
490        ("ipkg", "ipkg"),
491        ("iss", "iss"),
492        ("mst", "ist"),
493        ("ist", "ist"),
494        ("ijs", "j"),
495        ("JAL", "jal"),
496        ("jal", "jal"),
497        ("jpr", "jam"),
498        ("jpl", "jam"),
499        ("janet", "janet"),
500        ("jav", "java"),
501        ("java", "java"),
502        ("jsh", "java"),
503        ("jj", "javacc"),
504        ("jjt", "javacc"),
505        ("es", "javascript"),
506        ("mjs", "javascript"),
507        ("javascript", "javascript"),
508        ("js", "javascript"),
509        ("jsm", "javascript"),
510        ("cjs", "javascript"),
511        ("jsx", "javascriptreact"),
512        ("clp", "jess"),
513        ("jgr", "jgraph"),
514        ("jinja", "jinja"),
515        ("jjdescription", "jjdescription"),
516        ("j73", "jovial"),
517        ("jov", "jovial"),
518        ("jovial", "jovial"),
519        ("properties", "jproperties"),
520        ("jq", "jq"),
521        ("slnf", "json"),
522        ("json", "json"),
523        ("jsonp", "json"),
524        ("geojson", "json"),
525        ("mcmeta", "json"),
526        ("webmanifest", "json"),
527        ("ipynb", "json"),
528        ("jupyterlab-settings", "json"),
529        ("sublime-project", "json"),
530        ("sublime-settings", "json"),
531        ("sublime-workspace", "json"),
532        ("json-patch", "json"),
533        ("bd", "json"),
534        ("bda", "json"),
535        ("xci", "json"),
536        ("json5", "json5"),
537        ("jsonc", "jsonc"),
538        ("jsonl", "jsonl"),
539        ("jsonnet", "jsonnet"),
540        ("libsonnet", "jsonnet"),
541        ("jsp", "jsp"),
542        ("jl", "julia"),
543        ("just", "just"),
544        ("Just", "just"),
545        ("JUST", "just"),
546        ("kl", "karel"),
547        ("KL", "karel"),
548        ("kdl", "kdl"),
549        ("kv", "kivy"),
550        ("kix", "kix"),
551        ("kts", "kotlin"),
552        ("kt", "kotlin"),
553        ("ktm", "kotlin"),
554        ("sub", "krl"),
555        ("Sub", "krl"),
556        ("SUB", "krl"),
557        ("ks", "kscript"),
558        ("k", "kwt"),
559        ("ACE", "lace"),
560        ("ace", "lace"),
561        ("lalrpop", "lalrpop"),
562        ("latte", "latte"),
563        ("lte", "latte"),
564        ("ld", "ld"),
565        ("ldif", "ldif"),
566        ("lean", "lean"),
567        ("journal", "ledger"),
568        ("ldg", "ledger"),
569        ("ledger", "ledger"),
570        ("leo", "leo"),
571        ("less", "less"),
572        ("lex", "lex"),
573        ("lxx", "lex"),
574        ("l++", "lex"),
575        ("l", "lex"),
576        ("lhs", "lhaskell"),
577        ("lidr", "lidris2"),
578        ("ly", "lilypond"),
579        ("ily", "lilypond"),
580        ("liquid", "liquid"),
581        ("liq", "liquidsoap"),
582        ("L", "lisp"),
583        ("lisp", "lisp"),
584        ("el", "lisp"),
585        ("lsp", "lisp"),
586        ("asd", "lisp"),
587        ("lt", "lite"),
588        ("lite", "lite"),
589        ("livemd", "livebook"),
590        // TODO: could be lifelines
591        ("ll", "llvm"),
592        // TODO: could be other things
593        ("log", "upstreamlog"),
594        ("Log", "upstreamlog"),
595        ("LOG", "upstreamlog"),
596        ("lgt", "logtalk"),
597        ("lotos", "lotos"),
598        // TODO: could be lotos
599        ("lot", "tex"),
600        ("lout", "lout"),
601        ("lou", "lout"),
602        ("ulpc", "lpc"),
603        ("lpc", "lpc"),
604        // TODO: could be lpc
605        ("c", "c"),
606        // TODO: could be larch
607        ("lsl", "lsl"),
608        ("lss", "lss"),
609        ("nse", "lua"),
610        ("rockspec", "lua"),
611        ("lua", "lua"),
612        ("tlu", "lua"),
613        ("luau", "luau"),
614        ("lrc", "lyrics"),
615        // TODO: one of the most ambiguous ones
616        ("m", "matlab"),
617        ("at", "m4"),
618        // TODO: could be msmessages
619        ("mc", "m4"),
620        ("quake", "m3quake"),
621        // TODO: idek
622        ("m4", "m4"),
623        ("eml", "mail"),
624        // TODO: could be other flavors of make
625        ("mk", "make"),
626        ("mak", "make"),
627        ("page", "mallard"),
628        // TODO: could be lnkmap
629        ("map", "map"),
630        ("mws", "maple"),
631        ("mpl", "maple"),
632        ("mv", "maple"),
633        // TODO: could be fake markdowns
634        ("mkdn", "markdown"),
635        ("md", "markdown"),
636        ("mdwn", "markdown"),
637        ("mkd", "markdown"),
638        ("markdown", "markdown"),
639        ("mdown", "markdown"),
640        ("masm", "masm"),
641        ("mhtml", "mason"),
642        ("mason", "mason"),
643        ("master", "master"),
644        ("mas", "master"),
645        ("demo", "maxima"),
646        ("dm1", "maxima"),
647        ("dm2", "maxima"),
648        ("dm3", "maxima"),
649        ("dmt", "maxima"),
650        ("wxm", "maxima"),
651        ("mbsyncrc", "mbsync"),
652        ("mw", "mediawiki"),
653        ("wiki", "mediawiki"),
654        ("mel", "mel"),
655        ("mmd", "mermaid"),
656        ("mmdc", "mermaid"),
657        ("mermaid", "mermaid"),
658        ("mf", "mf"),
659        ("mgl", "mgl"),
660        ("mgp", "mgp"),
661        ("my", "mib"),
662        ("mib", "mib"),
663        ("mix", "mix"),
664        ("mixal", "mix"),
665        ("mlir", "mlir"),
666        // TODO: could be nroff
667        ("mm", "objc"),
668        ("nb", "mma"),
669        ("wl", "mma"),
670        ("mmp", "mmp"),
671        // TODO: could be mmix
672        ("mms", "make"),
673        // TODO: could be many things
674        ("mod", "gomod"),
675        ("Mod", "gomod"),
676        ("MOD", "gomod"),
677        ("DEF", "modula2"),
678        ("m3", "modula3"),
679        ("i3", "modula3"),
680        ("mg", "modula3"),
681        ("ig", "modula3"),
682        ("lm3", "modula3"),
683        ("mojo", "mojo"),
684        ("🔥", "mojo"), // 🙄
685        ("ssc", "monk"),
686        ("monk", "monk"),
687        ("tsc", "monk"),
688        ("isc", "monk"),
689        ("moo", "moo"),
690        ("moon", "moonscript"),
691        ("move", "move"),
692        ("mp", "mp"),
693        // TODO: idek
694        ("mpiv", "mp"),
695        ("mpvi", "mp"),
696        ("mpxl", "mp"),
697        ("mof", "msidl"),
698        ("odl", "msidl"),
699        ("msql", "msql"),
700        ("mss", "mss"),
701        ("mu", "mupad"),
702        ("mush", "mush"),
703        ("mustache", "mustache"),
704        ("mysql", "mysql"),
705        ("n1ql", "n1ql"),
706        ("nql", "n1ql"),
707        ("nanorc", "nanorc"),
708        ("nasm", "nasm"),
709        ("NSA", "natural"),
710        ("NSC", "natural"),
711        ("NSG", "natural"),
712        ("NSL", "natural"),
713        ("NSM", "natural"),
714        ("NSN", "natural"),
715        ("NSP", "natural"),
716        ("NSS", "natural"),
717        ("ncf", "ncf"),
718        ("nginx", "nginx"),
719        ("nim", "nim"),
720        ("nims", "nim"),
721        ("nimble", "nim"),
722        ("ninja", "ninja"),
723        ("nix", "nix"),
724        ("norg", "norg"),
725        ("nqc", "nqc"),
726        // TODO: nil-ing i guess?
727        ("0", "nroff"),
728        ("1", "nroff"),
729        ("2", "nroff"),
730        ("3", "nroff"),
731        ("4", "nroff"),
732        ("5", "nroff"),
733        ("6", "nroff"),
734        ("7", "nroff"),
735        ("8", "nroff"),
736        ("9", "nroff"),
737        ("0p", "nroff"),
738        ("1p", "nroff"),
739        ("3p", "nroff"),
740        ("1x", "nroff"),
741        ("2x", "nroff"),
742        ("3x", "nroff"),
743        ("4x", "nroff"),
744        ("5x", "nroff"),
745        ("6x", "nroff"),
746        ("7x", "nroff"),
747        ("8x", "nroff"),
748        ("3am", "nroff"),
749        ("3perl", "nroff"),
750        ("3pm", "nroff"),
751        ("3posix", "nroff"),
752        ("3type", "nroff"),
753        ("n", "nroff"),
754        ("roff", "nroff"),
755        ("tmac", "nroff"),
756        ("man", "nroff"),
757        ("mom", "nroff"),
758        ("nr", "nroff"),
759        ("tr", "nroff"),
760        ("nsi", "nsis"),
761        ("nsh", "nsis"),
762        ("nt", "ntriples"),
763        ("nu", "nu"),
764        ("obj", "obj"),
765        ("objdump", "objdump"),
766        ("cppobjdump", "objdump"),
767        ("obl", "obse"),
768        ("obse", "obse"),
769        ("oblivion", "obse"),
770        ("obscript", "obse"),
771        ("mlt", "ocaml"),
772        ("mly", "ocaml"),
773        ("mll", "ocaml"),
774        ("mlp", "ocaml"),
775        ("mlip", "ocaml"),
776        ("mli", "ocaml"),
777        ("ml", "ocaml"),
778        ("occ", "occam"),
779        ("odin", "odin"),
780        ("xom", "omnimark"),
781        ("xin", "omnimark"),
782        ("opam", "opam"),
783        ("or", "openroad"),
784        ("scad", "openscad"),
785        ("ovpn", "openvpn"),
786        ("opl", "opl"),
787        ("opL", "opl"),
788        ("oPl", "opl"),
789        ("oPL", "opl"),
790        ("Opl", "opl"),
791        ("OpL", "opl"),
792        ("OPl", "opl"),
793        ("OPL", "opl"),
794        ("ora", "ora"),
795        ("org", "org"),
796        ("org_archive", "org"),
797        ("pandoc", "pandoc"),
798        ("pdk", "pandoc"),
799        ("pd", "pandoc"),
800        ("pdc", "pandoc"),
801        ("pxsl", "papp"),
802        ("papp", "papp"),
803        ("pxml", "papp"),
804        ("pas", "pascal"),
805        // TODO: could be pascal
806        ("lpr", "xml"),
807        ("dpr", "pascal"),
808        ("txtpb", "pbtxt"),
809        ("textproto", "pbtxt"),
810        ("textpb", "pbtxt"),
811        ("pbtxt", "pbtxt"),
812        ("g", "pccts"),
813        ("pcmk", "pcmk"),
814        ("pdf", "pdf"),
815        ("pem", "pem"),
816        ("cer", "pem"),
817        ("crt", "pem"),
818        ("csr", "pem"),
819        ("plx", "perl"),
820        ("prisma", "prisma"),
821        ("psgi", "perl"),
822        ("al", "perl"),
823        ("ctp", "php"),
824        ("php", "php"),
825        ("phpt", "php"),
826        ("php0", "php"),
827        ("php1", "php"),
828        ("php2", "php"),
829        ("php3", "php"),
830        ("php4", "php"),
831        ("php5", "php"),
832        ("php6", "php"),
833        ("php7", "php"),
834        ("php8", "php"),
835        ("php9", "php"),
836        ("phtml", "php"),
837        ("theme", "php"),
838        ("pike", "pike"),
839        ("pmod", "pike"),
840        ("rcp", "pilrc"),
841        // TODO: could be prolog
842        ("PL", "perl"),
843        ("pli", "pli"),
844        ("pl1", "pli"),
845        ("p36", "plm"),
846        ("plm", "plm"),
847        ("pac", "plm"),
848        ("plp", "plp"),
849        ("pls", "plsql"),
850        ("plsql", "plsql"),
851        ("po", "po"),
852        ("pot", "po"),
853        ("pod", "pod"),
854        ("filter", "poefilter"),
855        ("pk", "poke"),
856        ("pony", "pony"),
857        ("ps", "postscr"),
858        ("epsi", "postscr"),
859        ("afm", "postscr"),
860        ("epsf", "postscr"),
861        ("eps", "postscr"),
862        ("pfa", "postscr"),
863        ("ai", "postscr"),
864        ("pov", "pov"),
865        ("ppd", "ppd"),
866        ("it", "ppwiz"),
867        ("ih", "ppwiz"),
868        ("pq", "pq"),
869        ("action", "privoxy"),
870        // TODO: could be clipper
871        ("prg", "rapid"),
872        ("Prg", "rapid"),
873        ("PRG", "rapid"),
874        ("pc", "proc"),
875        ("pdb", "prolog"),
876        ("pml", "promela"),
877        ("proto", "proto"),
878        ("prql", "prql"),
879        ("psd1", "ps1"),
880        ("psm1", "ps1"),
881        ("ps1", "ps1"),
882        ("pssc", "ps1"),
883        ("ps1xml", "ps1xml"),
884        ("psf", "psf"),
885        ("psl", "psl"),
886        ("ptx", "ptx"),
887        ("pug", "pug"),
888        ("purs", "purescript"),
889        ("arr", "pyret"),
890        ("pxd", "pyrex"),
891        ("pxi", "pyrex"),
892        ("pyx", "pyrex"),
893        ("pyx+", "pyrex"),
894        ("pyw", "python"),
895        ("py", "python"),
896        ("pyi", "python"),
897        ("ptl", "python"),
898        ("ipy", "python"),
899        ("ql", "ql"),
900        ("qll", "ql"),
901        ("qml", "qml"),
902        ("qbs", "qml"),
903        ("qmd", "quarto"),
904        // TODO: could be other things
905        ("R", "r"),
906        ("rkt", "racket"),
907        ("rktd", "racket"),
908        ("rktl", "racket"),
909        ("rad", "radiance"),
910        ("mat", "radiance"),
911        ("pod6", "raku"),
912        ("rakudoc", "raku"),
913        ("rakutest", "raku"),
914        ("rakumod", "raku"),
915        ("pm6", "raku"),
916        ("raku", "raku"),
917        ("t6", "raku"),
918        ("p6", "raku"),
919        ("raml", "raml"),
920        ("sysx", "rapid"),
921        ("sysX", "rapid"),
922        ("Sysx", "rapid"),
923        ("SysX", "rapid"),
924        ("SYSX", "rapid"),
925        ("SYSx", "rapid"),
926        ("modx", "rapid"),
927        ("modX", "rapid"),
928        ("Modx", "rapid"),
929        ("ModX", "rapid"),
930        ("MODX", "rapid"),
931        ("MODx", "rapid"),
932        ("rasi", "rasi"),
933        ("rbs", "rbs"),
934        ("rego", "rego"),
935        ("rem", "remind"),
936        ("remind", "remind"),
937        ("pip", "requirements"),
938        ("res", "rescript"),
939        ("resi", "rescript"),
940        ("frt", "reva"),
941        ("testUnit", "rexx"),
942        ("rex", "rexx"),
943        ("orx", "rexx"),
944        ("rexx", "rexx"),
945        ("jrexx", "rexx"),
946        ("rxj", "rexx"),
947        ("rexxj", "rexx"),
948        ("testGroup", "rexx"),
949        ("rxo", "rexx"),
950        ("Rd", "rhelp"),
951        ("rd", "rhelp"),
952        ("rib", "rib"),
953        ("Rmd", "rmd"),
954        ("rmd", "rmd"),
955        ("smd", "rmd"),
956        ("Smd", "rmd"),
957        ("rnc", "rnc"),
958        ("rng", "rng"),
959        ("rnw", "rnoweb"),
960        ("snw", "rnoweb"),
961        ("Rnw", "rnoweb"),
962        ("Snw", "rnoweb"),
963        ("robot", "robot"),
964        ("resource", "robot"),
965        ("roc", "roc"),
966        ("ron", "ron"),
967        ("rsc", "routeros"),
968        ("x", "rpcgen"),
969        ("rpgle", "rpgle"),
970        ("rpgleinc", "rpgle"),
971        ("rpl", "rpl"),
972        ("Srst", "rrst"),
973        ("srst", "rrst"),
974        ("Rrst", "rrst"),
975        ("rrst", "rrst"),
976        ("rst", "rst"),
977        ("rtf", "rtf"),
978        ("rjs", "ruby"),
979        ("rxml", "ruby"),
980        ("rb", "ruby"),
981        ("rant", "ruby"),
982        ("ru", "ruby"),
983        ("rbw", "ruby"),
984        ("gemspec", "ruby"),
985        ("builder", "ruby"),
986        ("rake", "ruby"),
987        ("rs", "rust"),
988        // TODO: could be sather
989        ("sa", "tiasm"),
990        ("sage", "sage"),
991        ("sls", "salt"),
992        ("sas", "sas"),
993        ("sass", "sass"),
994        ("sbt", "sbt"),
995        ("scala", "scala"),
996        ("mill", "scala"),
997        ("ss", "scheme"),
998        ("scm", "scheme"),
999        ("sld", "scheme"),
1000        ("stsg", "scheme"),
1001        ("sce", "scilab"),
1002        ("sci", "scilab"),
1003        ("scss", "scss"),
1004        ("sd", "sd"),
1005        ("sdc", "sdc"),
1006        ("pr", "sdl"),
1007        ("sdl", "sdl"),
1008        ("sed", "sed"),
1009        ("sexp", "sexplib"),
1010        // TODO: #! /bin/{other shells i asume}
1011        ("bash", "bash"),
1012        ("bats", "bash"),
1013        ("cygport", "bash"),
1014        ("ebuild", "bash"),
1015        ("eclass", "bash"),
1016        ("env", "bash"),
1017        ("envrc", "bash"),
1018        ("ksh", "ksh"),
1019        ("sh", "bash"),
1020        ("lo", "sh"),
1021        ("la", "sh"),
1022        ("lai", "sh"),
1023        ("mdd", "sh"),
1024        ("slang", "shaderslang"),
1025        ("sieve", "sieve"),
1026        ("siv", "sieve"),
1027        // TODO: could be lprolog
1028        ("sig", "sml"),
1029        // TODO: could be sile
1030        ("sil", "sil"),
1031        ("sim", "simula"),
1032        ("s85", "sinda"),
1033        ("sin", "sinda"),
1034        ("ssm", "sisu"),
1035        ("sst", "sisu"),
1036        ("ssi", "sisu"),
1037        ("_sst", "sisu"),
1038        ("-sst", "sisu"),
1039        ("il", "skill"),
1040        ("ils", "skill"),
1041        ("cdf", "skill"),
1042        ("sl", "slang"),
1043        ("ice", "slice"),
1044        ("slint", "slint"),
1045        ("score", "slrnsc"),
1046        ("sol", "solidity"),
1047        ("smali", "smali"),
1048        ("tpl", "smarty"),
1049        ("ihlp", "smcl"),
1050        ("smcl", "smcl"),
1051        ("hlp", "smcl"),
1052        ("smith", "smith"),
1053        ("smt", "smith"),
1054        ("smithy", "smithy"),
1055        ("sml", "sml"),
1056        ("smk", "snakemake"),
1057        ("spt", "snobol4"),
1058        ("sno", "snobol4"),
1059        ("sln", "solution"),
1060        ("sparql", "sparql"),
1061        ("rq", "sparql"),
1062        ("spec", "spec"),
1063        ("spice", "spice"),
1064        ("sp", "spice"),
1065        ("spd", "spup"),
1066        ("spdata", "spup"),
1067        ("speedup", "spup"),
1068        ("spi", "spyce"),
1069        ("spy", "spyce"),
1070        ("tyc", "sql"),
1071        // TODO: could be sql, but I'm biased
1072        ("typ", "typst"),
1073        ("pkb", "sql"),
1074        ("tyb", "sql"),
1075        ("pks", "sql"),
1076        ("sqlj", "sqlj"),
1077        ("sqi", "sqr"),
1078        ("sqr", "sqr"),
1079        ("nut", "squirrel"),
1080        // TODO: could be other things
1081        ("src", "krl"),
1082        ("Src", "krl"),
1083        ("SRC", "krl"),
1084        ("s28", "srec"),
1085        ("s37", "srec"),
1086        ("srec", "srec"),
1087        ("mot", "srec"),
1088        ("s19", "srec"),
1089        ("srt", "srt"),
1090        ("ssa", "ssa"),
1091        ("ass", "ssa"),
1092        ("st", "st"),
1093        ("ipd", "starlark"),
1094        ("star", "starlark"),
1095        ("starlark", "starlark"),
1096        ("imata", "stata"),
1097        ("do", "stata"),
1098        ("mata", "stata"),
1099        ("ado", "stata"),
1100        ("stp", "stp"),
1101        ("styl", "stylus"),
1102        ("stylus", "stylus"),
1103        ("quark", "supercollider"),
1104        ("sface", "surface"),
1105        ("svelte", "svelte"),
1106        ("svg", "svg"),
1107        ("sw", "sway"),
1108        ("swift", "swift"),
1109        ("swiftinterface", "swift"),
1110        ("swig", "swig"),
1111        ("swg", "swig"),
1112        // TODO: could be rapid
1113        ("sys", "bat"),
1114        ("Sys", "bat"),
1115        ("SYS", "bat"),
1116        ("svh", "systemverilog"),
1117        ("sv", "systemverilog"),
1118        ("cmm", "trace32"),
1119        ("cmmt", "trace32"),
1120        ("t32", "trace32"),
1121        ("td", "tablegen"),
1122        ("tak", "tak"),
1123        ("tal", "tal"),
1124        ("task", "taskedit"),
1125        ("tm", "tcl"),
1126        ("tcl", "tcl"),
1127        ("itk", "tcl"),
1128        ("itcl", "tcl"),
1129        ("tk", "tcl"),
1130        ("jacl", "tcl"),
1131        ("tl", "teal"),
1132        ("templ", "templ"),
1133        ("tmpl", "template"),
1134        ("tera", "tera"),
1135        ("ti", "terminfo"),
1136        ("dtx", "tex"),
1137        ("ltx", "tex"),
1138        ("bbl", "tex"),
1139        ("latex", "tex"),
1140        ("sty", "tex"),
1141        ("pgf", "tex"),
1142        ("nlo", "tex"),
1143        ("nls", "tex"),
1144        ("thm", "tex"),
1145        ("eps_tex", "tex"),
1146        ("pdf_tex", "tex"),
1147        ("pygtex", "tex"),
1148        ("pygstyle", "tex"),
1149        ("clo", "tex"),
1150        ("aux", "tex"),
1151        ("brf", "tex"),
1152        ("ind", "tex"),
1153        ("lof", "tex"),
1154        ("loe", "tex"),
1155        ("nav", "tex"),
1156        ("vrb", "tex"),
1157        ("ins", "tex"),
1158        ("tikz", "tex"),
1159        ("bbx", "tex"),
1160        ("cbx", "tex"),
1161        ("beamer", "tex"),
1162        // TODO: could be many things
1163        ("cls", "st"),
1164        ("texi", "texinfo"),
1165        ("txi", "texinfo"),
1166        ("texinfo", "texinfo"),
1167        ("text", "text"),
1168        ("tfvars", "terraform-vars"),
1169        ("thrift", "thrift"),
1170        ("tla", "tla"),
1171        ("tli", "tli"),
1172        ("toml", "toml"),
1173        ("tpp", "tpp"),
1174        ("treetop", "treetop"),
1175        ("trig", "trig"),
1176        ("slt", "tsalt"),
1177        ("tsscl", "tsscl"),
1178        ("tssgm", "tssgm"),
1179        ("tssop", "tssop"),
1180        ("tsv", "tsv"),
1181        ("tutor", "tutor"),
1182        ("twig", "twig"),
1183        // TODO: could be sql (greedy ahh language)
1184        ("ts", "typescript"),
1185        ("mts", "typescript"),
1186        ("cts", "typescript"),
1187        ("tsx", "typescriptreact"),
1188        ("tsp", "typespec"),
1189        ("uc", "uc"),
1190        ("uit", "uil"),
1191        ("uil", "uil"),
1192        ("ungram", "ungrammar"),
1193        ("u", "unison"),
1194        ("uu", "unison"),
1195        ("url", "urlshortcut"),
1196        ("usd", "usd"),
1197        ("usda", "usd"),
1198        // TODO: could be coq (🤤)
1199        ("v", "v"),
1200        ("vsh", "v"),
1201        ("vv", "v"),
1202        ("ctl", "vb"),
1203        ("dob", "vb"),
1204        ("dsm", "vb"),
1205        ("dsr", "vb"),
1206        ("pag", "vb"),
1207        ("sba", "vb"),
1208        ("vb", "vb"),
1209        ("vbs", "vb"),
1210        // TODO: could be vim (???)
1211        ("vba", "vb"),
1212        ("vdf", "vdf"),
1213        ("vdmpp", "vdmpp"),
1214        ("vpp", "vdmpp"),
1215        ("vdmrt", "vdmrt"),
1216        ("vdmsl", "vdmsl"),
1217        ("vdm", "vdmsl"),
1218        ("vto", "vento"),
1219        ("vr", "vera"),
1220        ("vri", "vera"),
1221        ("vrh", "vera"),
1222        ("va", "verilogams"),
1223        ("vams", "verilogams"),
1224        ("vhdl", "vhdl"),
1225        ("vst", "vhdl"),
1226        ("vhd", "vhdl"),
1227        ("hdl", "vhdl"),
1228        ("vho", "vhdl"),
1229        ("vbe", "vhdl"),
1230        ("tape", "vhs"),
1231        ("vim", "vim"),
1232        ("mar", "vmasm"),
1233        ("cm", "voscm"),
1234        ("wrl", "vrml"),
1235        ("vroom", "vroom"),
1236        ("vue", "vue"),
1237        ("wast", "wat"),
1238        ("wat", "wat"),
1239        ("wdl", "wdl"),
1240        ("wm", "webmacro"),
1241        ("wgsl", "wgsl"),
1242        ("wbt", "winbatch"),
1243        ("wit", "wit"),
1244        ("wml", "wml"),
1245        ("wsf", "wsh"),
1246        ("wsc", "wsh"),
1247        ("wsml", "wsml"),
1248        ("ad", "xdefaults"),
1249        ("xhtml", "xhtml"),
1250        ("xht", "xhtml"),
1251        ("msc", "xmath"),
1252        ("msf", "xmath"),
1253        ("psc1", "xml"),
1254        ("tpm", "xml"),
1255        ("xliff", "xml"),
1256        ("atom", "xml"),
1257        ("xul", "xml"),
1258        ("cdxml", "xml"),
1259        ("mpd", "xml"),
1260        ("rss", "xml"),
1261        ("fsproj", "xml"),
1262        ("ui", "xml"),
1263        ("vbproj", "xml"),
1264        ("xlf", "xml"),
1265        ("wsdl", "xml"),
1266        ("csproj", "xml"),
1267        ("wpl", "xml"),
1268        ("xmi", "xml"),
1269        ("xpr", "xml"),
1270        ("xpfm", "xml"),
1271        ("spfm", "xml"),
1272        ("bxml", "xml"),
1273        ("mmi", "xml"),
1274        ("xcu", "xml"),
1275        ("xlb", "xml"),
1276        ("xlc", "xml"),
1277        ("xba", "xml"),
1278        ("slnx", "xml"),
1279        // TODO: could be xpm2 or XPM2 (which are obviously not the same things)
1280        ("xpm", "xpm"),
1281        ("xpm2", "xpm2"),
1282        ("xqy", "xquery"),
1283        ("xqm", "xquery"),
1284        ("xquery", "xquery"),
1285        ("xq", "xquery"),
1286        ("xql", "xquery"),
1287        ("xs", "xs"),
1288        ("xsd", "xsd"),
1289        ("xsl", "xslt"),
1290        ("xslt", "xslt"),
1291        ("yy", "yacc"),
1292        ("y++", "yacc"),
1293        ("yxx", "yacc"),
1294        ("yml", "yaml"),
1295        ("yaml", "yaml"),
1296        ("eyaml", "yaml"),
1297        ("mplstyle", "yaml"),
1298        // TODO: could be xml
1299        ("grc", "yaml"),
1300        ("yang", "yang"),
1301        ("yuck", "yuck"),
1302        ("z8a", "z8a"),
1303        ("zig", "zig"),
1304        ("zon", "zig"),
1305        ("ziggy", "ziggy"),
1306        ("ziggy-schema", "ziggy_schema"),
1307        ("zu", "zimbu"),
1308        ("zut", "zimbutempl"),
1309        ("zs", "zserio"),
1310        ("zsh", "zsh"),
1311        ("zunit", "zsh"),
1312        ("zsh-theme", "zsh"),
1313        ("vala", "vala"),
1314        // TODO: could be winbatch
1315        ("web", "web"),
1316        // TODO: could be prolog
1317        ("pl", "perl"),
1318        // TODO: could be puppet
1319        ("pp", "pascal"),
1320        // TODO: could be swig 🍺
1321        ("i", "progress"),
1322        // TODO: could be cweb
1323        ("w", "progress"),
1324        // TODO: could be progress
1325        ("p", "pascal"),
1326        // TODO: could be other things
1327        ("pro", "prolog"),
1328        // TODO: could be patch
1329        ("patch", "diff"),
1330        // TODO: could be rexx
1331        ("r", "r"),
1332        // TODO: nil-ing i guess?
1333        ("rdf", "redif"),
1334        // TODO: AAAAAAAAAAAAAAAAAA
1335        ("rules", "javascript"),
1336        // TODO: could be superdupermegahypercolider
1337        ("sc", "scala"),
1338        // TODO: could be superdupermegahypercolider as well
1339        ("scd", "scdoc"),
1340        // TODO: idek
1341        ("tcsh", "tcsh"),
1342        // TODO: could be other sql flavors
1343        ("sql", "sql"),
1344        ("zsql", "sql"),
1345        // TODO: could be other tex flavors
1346        ("tex", "tex"),
1347        // TODO: could be terraform
1348        ("tf", "tf"),
1349        // TODO: which languages dare?
1350        ("txt", "text"),
1351        // TODO: could be other, secret xmls
1352        ("xml", "xml"),
1353        // TODO: racc is not yacc, bro
1354        ("y", "yacc"),
1355        // TODO: could be other irrelevant things
1356        ("cmd", "dosbatch"),
1357        // TODO: could be diva 💅
1358        ("rul", "ishd"),
1359        // TODO: could be cobol
1360        ("cpy", "python"),
1361        // TODO: could be structurizr
1362        ("dsl", "dsl"),
1363        // TODO: could be xml
1364        ("smil", "smil"),
1365        // TODO: could be mib 🕴
1366        ("smi", "smil"),
1367        // TODO: could be php
1368        ("install", "bash"),
1369        // TODO: could be the infamous xpm or its dastardly cousin, xpm2
1370        ("pm", "perl"),
1371        // TODO: could be nroff, again
1372        ("me", "objcpp"),
1373        // TODO: nil-ing i guess?
1374        ("reg", "registry"),
1375        // TODO: could be turtle 🐢
1376        ("ttl", "terraterm"),
1377        // TODO: could not be muttrc
1378        ("rc", "rc"),
1379        ("rch", "rc"),
1380        // TODO: nil-ing i guess?
1381        ("class", "scala"),
1382        // TODO: could be other things
1383        ("sgml", "sgml"),
1384        ("sgm", "sgml"),
1385        // TODO: could be nroff or tads
1386        ("t", "perl"),
1387        // No match means there is no clear language
1388        ("bak", ""),
1389        ("dpkg-bak", ""),
1390        ("dpkg-dist", ""),
1391        ("dpkg-old", ""),
1392        ("dpkg-new", ""),
1393        ("in", ""),
1394        ("new", ""),
1395        ("old", ""),
1396        ("orig", ""),
1397        ("pacsave", ""),
1398        ("pacnew", ""),
1399        ("rpmsave", ""),
1400        ("rmpnew", ""),
1401    ])
1402});
1403
1404static FILENAMES: LazyLock<HashMap<&str, &str>> = LazyLock::new(|| {
1405    HashMap::from_iter([
1406        ("a2psrc", "a2ps"),
1407        ("/etc/a2ps.cfg", "a2ps"),
1408        (".a2psrc", "a2ps"),
1409        (".asoundrc", "alsaconf"),
1410        ("/usr/share/alsa/alsa.conf", "alsaconf"),
1411        ("/etc/asound.conf", "alsaconf"),
1412        ("build.xml", "ant"),
1413        (".htaccess", "apache"),
1414        ("APKBUILD", "apkbuild"),
1415        ("apt.conf", "aptconf"),
1416        ("/.aptitude/config", "aptconf"),
1417        ("=tagging-method", "arch"),
1418        (".arch-inventory", "arch"),
1419        ("makefile.am", "automake"),
1420        ("Makefile.am", "automake"),
1421        ("GNUmakefile.am", "automake"),
1422        (".bash_aliases", "bash"),
1423        (".bash-aliases", "bash"),
1424        (".bash_history", "bash"),
1425        (".bash-history", "bash"),
1426        (".bash_logout", "bash"),
1427        (".bash-logout", "bash"),
1428        (".bash_profile", "bash"),
1429        (".bash-profile", "bash"),
1430        ("named.root", "bindzone"),
1431        ("WORKSPACE", "bzl"),
1432        ("WORKSPACE.bzlmod", "bzl"),
1433        ("BUCK", "bzl"),
1434        ("BUILD", "bzl"),
1435        ("cabal.project", "cabalproject"),
1436        ("cabal.config", "cabalconfig"),
1437        ("calendar", "calendar"),
1438        ("catalog", "catalog"),
1439        ("/etc/cdrdao.conf", "cdrdaoconf"),
1440        (".cdrdao", "cdrdaoconf"),
1441        ("/etc/default/cdrdao", "cdrdaoconf"),
1442        ("/etc/defaults/cdrdao", "cdrdaoconf"),
1443        ("cfengine.conf", "cfengine"),
1444        ("cgdbrc", "cgdbrc"),
1445        ("init.trans", "clojure"),
1446        (".trans", "clojure"),
1447        ("CMakeLists.txt", "cmake"),
1448        ("CMakeCache.txt", "cmakecache"),
1449        (".cling_history", "cpp"),
1450        (".alias", "csh"),
1451        (".cshrc", "csh"),
1452        (".login", "csh"),
1453        ("csh.cshrc", "csh"),
1454        ("csh.login", "csh"),
1455        ("csh.logout", "csh"),
1456        ("auto.master", "conf"),
1457        ("texdoc.cnf", "conf"),
1458        (".x11vncrc", "conf"),
1459        (".chktexrc", "conf"),
1460        (".ripgreprc", "conf"),
1461        ("ripgreprc", "conf"),
1462        ("configure.in", "config"),
1463        ("configure.ac", "config"),
1464        ("crontab", "crontab"),
1465        (".cvsrc", "cvsrc"),
1466        ("/debian/changelog", "debchangelog"),
1467        ("changelog.dch", "debchangelog"),
1468        ("changelog.Debian", "debchangelog"),
1469        ("NEWS.dch", "debchangelog"),
1470        ("NEWS.Debian", "debchangelog"),
1471        ("/debian/control", "debcontrol"),
1472        ("/DEBIAN/control", "debcontrol"),
1473        ("/debian/copyright", "debcopyright"),
1474        ("/etc/apt/sources.list", "debsources"),
1475        ("denyhosts.conf", "denyhosts"),
1476        ("dict.conf", "dictconf"),
1477        (".dictrc", "dictconf"),
1478        ("/etc/DIR_COLORS", "dircolors"),
1479        (".dir_colors", "dircolors"),
1480        (".dircolors", "dircolors"),
1481        ("/etc/dnsmasq.conf", "dnsmasq"),
1482        ("Containerfile", "dockerfile"),
1483        ("dockerfile", "dockerfile"),
1484        ("Dockerfile", "dockerfile"),
1485        ("npmrc", "dosini"),
1486        ("/etc/yum.conf", "dosini"),
1487        (".npmrc", "dosini"),
1488        ("pip.conf", "dosini"),
1489        ("setup.cfg", "dosini"),
1490        ("pudb.cfg", "dosini"),
1491        (".coveragerc", "dosini"),
1492        (".pypirc", "dosini"),
1493        (".pylintrc", "dosini"),
1494        ("pylintrc", "dosini"),
1495        (".replyrc", "dosini"),
1496        (".gitlint", "dosini"),
1497        (".oelint.cfg", "dosini"),
1498        ("psprint.conf", "dosini"),
1499        ("sofficerc", "dosini"),
1500        ("mimeapps.list", "dosini"),
1501        (".wakatime.cfg", "dosini"),
1502        ("nfs.conf", "dosini"),
1503        ("nfsmount.conf", "dosini"),
1504        (".notmuch-config", "dosini"),
1505        (".alsoftrc", "dosini"),
1506        ("alsoft.conf", "dosini"),
1507        ("alsoft.ini", "dosini"),
1508        ("alsoftrc.sample", "dosini"),
1509        ("pacman.conf", "confini"),
1510        ("paru.conf", "confini"),
1511        ("mpv.conf", "confini"),
1512        ("dune", "dune"),
1513        ("jbuild", "dune"),
1514        ("dune-workspace", "dune"),
1515        ("dune-project", "dune"),
1516        ("dune-file", "dune"),
1517        ("Earthfile", "earthfile"),
1518        (".editorconfig", "editorconfig"),
1519        ("elinks.conf", "elinks"),
1520        ("mix.lock", "elixir"),
1521        ("filter-rules", "elmfilt"),
1522        ("exim.conf", "exim"),
1523        ("exports", "exports"),
1524        ("fennelrc", "fennel"),
1525        (".fennelrc", "fennel"),
1526        (".fetchmailrc", "fetchmail"),
1527        // TODO: nil-ing i guess?
1528        ("fvSchemes", "foam"),
1529        ("fvSolution", "foam"),
1530        ("fvConstraints", "foam"),
1531        ("fvModels", "foam"),
1532        ("fstab", "fstab"),
1533        ("mtab", "fstab"),
1534        (".gdbinit", "gdb"),
1535        ("gdbinit", "gdb"),
1536        (".gdbearlyinit", "gdb"),
1537        ("gdbearlyinit", "gdb"),
1538        ("lltxxxxx.txt", "gedcom"),
1539        ("TAG_EDITMSG", "gitcommit"),
1540        ("MERGE_MSG", "gitcommit"),
1541        ("COMMIT_EDITMSG", "gitcommit"),
1542        ("NOTES_EDITMSG", "gitcommit"),
1543        ("EDIT_DESCRIPTION", "gitcommit"),
1544        (".gitconfig", "gitconfig"),
1545        (".gitmodules", "gitconfig"),
1546        (".gitattributes", "gitattributes"),
1547        (".gitignore", "gitignore"),
1548        (".ignore", "gitignore"),
1549        (".containerignore", "gitignore"),
1550        (".dockerignore", "gitignore"),
1551        (".fdignore", "gitignore"),
1552        (".npmignore", "gitignore"),
1553        (".rgignore", "gitignore"),
1554        (".vscodeignore", "gitignore"),
1555        ("gitolite.conf", "gitolite"),
1556        ("git-rebase-todo", "gitrebase"),
1557        ("gkrellmrc", "gkrellmrc"),
1558        (".gnashrc", "gnash"),
1559        (".gnashpluginrc", "gnash"),
1560        ("gnashpluginrc", "gnash"),
1561        ("gnashrc", "gnash"),
1562        (".gnuplot_history", "gnuplot"),
1563        ("goaccess.conf", "goaccess"),
1564        ("go.sum", "gosum"),
1565        ("go.work.sum", "gosum"),
1566        ("go.work", "gowork"),
1567        (".gprc", "gp"),
1568        ("/.gnupg/gpg.conf", "gpg"),
1569        ("/.gnupg/options", "gpg"),
1570        ("Jenkinsfile", "groovy"),
1571        ("/var/backups/gshadow.bak", "group"),
1572        ("/etc/gshadow", "group"),
1573        ("/etc/group-", "group"),
1574        ("/etc/gshadow.edit", "group"),
1575        ("/etc/gshadow-", "group"),
1576        ("/etc/group", "group"),
1577        ("/var/backups/group.bak", "group"),
1578        ("/etc/group.edit", "group"),
1579        ("/boot/grub/menu.lst", "grub"),
1580        ("/etc/grub.conf", "grub"),
1581        ("/boot/grub/grub.conf", "grub"),
1582        (".gtkrc", "gtkrc"),
1583        ("gtkrc", "gtkrc"),
1584        ("snort.conf", "hog"),
1585        ("vision.conf", "hog"),
1586        ("/etc/host.conf", "hostconf"),
1587        ("/etc/hosts.allow", "hostsaccess"),
1588        ("/etc/hosts.deny", "hostsaccess"),
1589        (".hy-history", "hy"),
1590        ("hyprland.conf", "hyprlang"),
1591        ("hyprpaper.conf", "hyprlang"),
1592        ("hypridle.conf", "hyprlang"),
1593        ("hyprlock.conf", "hyprlang"),
1594        ("/.icewm/menu", "icemenu"),
1595        (".indent.pro", "indent"),
1596        ("indentrc", "indent"),
1597        ("inittab", "inittab"),
1598        ("ipf.conf", "ipfilter"),
1599        ("ipf6.conf", "ipfilter"),
1600        ("ipf.rules", "ipfilter"),
1601        (".bun_repl_history", "javascript"),
1602        (".node_repl_history", "javascript"),
1603        ("deno_history.txt", "javascript"),
1604        ("Pipfile.lock", "json"),
1605        (".firebaserc", "json"),
1606        (".prettierrc", "json"),
1607        (".stylelintrc", "json"),
1608        (".lintstagedrc", "json"),
1609        ("deno.lock", "json"),
1610        ("flake.lock", "json"),
1611        (".swcrc", "json"),
1612        (".babelrc", "jsonc"),
1613        (".eslintrc", "jsonc"),
1614        (".hintrc", "jsonc"),
1615        (".jscsrc", "jsonc"),
1616        (".jsfmtrc", "jsonc"),
1617        (".jshintrc", "jsonc"),
1618        (".luaurc", "jsonc"),
1619        (".swrc", "jsonc"),
1620        (".vsconfig", "jsonc"),
1621        ("bun.lock", "jsonc"),
1622        (".justfile", "just"),
1623        (".Justfile", "just"),
1624        (".JUSTFILE", "just"),
1625        ("justfile", "just"),
1626        ("Justfile", "just"),
1627        ("JUSTFILE", "just"),
1628        ("Kconfig", "kconfig"),
1629        ("Kconfig.debug", "kconfig"),
1630        ("Config.in", "kconfig"),
1631        ("ldaprc", "ldapconf"),
1632        (".ldaprc", "ldapconf"),
1633        ("ldap.conf", "ldapconf"),
1634        ("lfrc", "lf"),
1635        ("lftp.conf", "lftp"),
1636        (".lftprc", "lftp"),
1637        ("/.libao", "libao"),
1638        ("/etc/libao.conf", "libao"),
1639        ("lilo.conf", "lilo"),
1640        ("/etc/limits", "limits"),
1641        (".emacs", "lisp"),
1642        ("sbclrc", "lisp"),
1643        (".sbclrc", "lisp"),
1644        (".sawfishrc", "lisp"),
1645        ("/etc/login.access", "loginaccess"),
1646        ("/etc/login.defs", "logindefs"),
1647        (".lsl", "lsl"),
1648        (".busted", "lua"),
1649        (".luacheckrc", "lua"),
1650        (".lua_history", "lua"),
1651        ("config.ld", "lua"),
1652        ("rock_manifest", "lua"),
1653        ("lynx.cfg", "lynx"),
1654        ("m3overrides", "m3build"),
1655        ("m3makefile", "m3build"),
1656        ("cm3.cfg", "m3quake"),
1657        (".m4_history", "m4"),
1658        (".followup", "mail"),
1659        (".article", "mail"),
1660        (".letter", "mail"),
1661        ("/etc/aliases", "mailaliases"),
1662        ("/etc/mail/aliases", "mailaliases"),
1663        ("mailcap", "mailcap"),
1664        (".mailcap", "mailcap"),
1665        ("Kbuild", "make"),
1666        ("/etc/man.conf", "manconf"),
1667        ("man.config", "manconf"),
1668        ("maxima-init.mac", "maxima"),
1669        ("isyncrc", "mbsync"),
1670        ("meson.build", "meson"),
1671        ("meson.options", "meson"),
1672        ("meson_options.txt", "meson"),
1673        ("/etc/conf.modules", "modconf"),
1674        ("/etc/modules", "modconf"),
1675        ("/etc/modules.conf", "modconf"),
1676        ("/.mplayer/config", "mplayerconf"),
1677        ("mplayer.conf", "mplayerconf"),
1678        ("mrxvtrc", "mrxvtrc"),
1679        (".mrxvtrc", "mrxvtrc"),
1680        (".msmtprc", "msmtp"),
1681        ("Muttngrc", "muttrc"),
1682        ("Muttrc", "muttrc"),
1683        (".mysql_history", "mysql"),
1684        ("/etc/nanorc", "nanorc"),
1685        ("Neomuttrc", "neomuttrc"),
1686        (".netrc", "netrc"),
1687        // TODO: nil-ing i guess?
1688        ("NEWS", "debchangelog"),
1689        (".ocamlinit", "ocaml"),
1690        (".octaverc", "octave"),
1691        ("octaverc", "octave"),
1692        ("octave.conf", "octave"),
1693        (".ondirrc", "ondir"),
1694        ("opam", "opam"),
1695        ("opam.locked", "opam"),
1696        ("/etc/pam.conf", "pamconf"),
1697        ("pam_env.conf", "pamenv"),
1698        (".pam_environment", "pamenv"),
1699        ("/var/backups/passwd.bak", "passwd"),
1700        ("/var/backups/shadow.bak", "passwd"),
1701        ("/etc/passwd", "passwd"),
1702        ("/etc/passwd-", "passwd"),
1703        ("/etc/shadow.edit", "passwd"),
1704        ("/etc/shadow-", "passwd"),
1705        ("/etc/shadow", "passwd"),
1706        ("/etc/passwd.edit", "passwd"),
1707        (".gitolite.rc", "perl"),
1708        ("gitolite.rc", "perl"),
1709        ("example.gitolite.rc", "perl"),
1710        ("latexmkrc", "perl"),
1711        (".latexmkrc", "perl"),
1712        ("pf.conf", "pf"),
1713        ("main.cf", "pfmain"),
1714        ("main.cf.proto", "pfmain"),
1715        ("pinerc", "pine"),
1716        (".pinercex", "pine"),
1717        (".pinerc", "pine"),
1718        ("pinercex", "pine"),
1719        ("/etc/pinforc", "pinfo"),
1720        ("/.pinforc", "pinfo"),
1721        (".povrayrc", "povini"),
1722        // TODO: idek
1723        ("printcap", "ptcap"),
1724        ("termcap", "ptcap"),
1725        (".procmailrc", "procmail"),
1726        (".procmail", "procmail"),
1727        // TODO: could be other things
1728        ("indent.pro", "cpp"),
1729        ("/etc/protocols", "protocols"),
1730        // TODO: nil-ing i guess?
1731        ("INDEX", "psf"),
1732        ("INFO", "psf"),
1733        ("MANIFEST.in", "pymanifest"),
1734        (".pythonstartup", "python"),
1735        (".pythonrc", "python"),
1736        (".python_history", "python"),
1737        (".jline-jython.history", "python"),
1738        ("SConstruct", "python"),
1739        ("qmldir", "qmldir"),
1740        (".Rhistory", "r"),
1741        (".Rprofile", "r"),
1742        ("Rprofile", "r"),
1743        ("Rprofile.site", "r"),
1744        ("ratpoisonrc", "ratpoison"),
1745        (".ratpoisonrc", "ratpoison"),
1746        ("inputrc", "readline"),
1747        (".inputrc", "readline"),
1748        (".reminders", "remind"),
1749        ("requirements.txt", "requirements"),
1750        ("constraints.txt", "requirements"),
1751        ("requirements.in", "requirements"),
1752        ("resolv.conf", "resolv"),
1753        ("robots.txt", "robots"),
1754        ("Gemfile", "ruby"),
1755        ("Puppetfile", "ruby"),
1756        (".irbrc", "ruby"),
1757        ("irbrc", "ruby"),
1758        (".irb_history", "ruby"),
1759        ("irb_history", "ruby"),
1760        ("rakefile", "ruby"),
1761        ("Rakefile", "ruby"),
1762        ("rantfile", "ruby"),
1763        ("Rantfile", "ruby"),
1764        ("Vagrantfile", "ruby"),
1765        ("smb.conf", "samba"),
1766        (".lips_repl_history", "scheme"),
1767        (".guile", "scheme"),
1768        ("screenrc", "screen"),
1769        (".screenrc", "screen"),
1770        ("/etc/sensors3.conf", "sensors"),
1771        ("/etc/sensors.conf", "sensors"),
1772        ("/etc/services", "services"),
1773        ("/etc/serial.conf", "setserial"),
1774        ("/etc/udev/cdsymlinks.conf", "sh"),
1775        (".ash_history", "sh"),
1776        (".devscripts", "sh"),
1777        ("devscripts.conf", "sh"),
1778        ("makepkg.conf", "sh"),
1779        (".makepkg.conf", "sh"),
1780        ("user-dirs.dirs", "sh"),
1781        ("user-dirs.defaults", "sh"),
1782        (".xprofile", "sh"),
1783        ("bash.bashrc", "bash"),
1784        ("bashrc", "bash"),
1785        (".bashrc", "bash"),
1786        (".kshrc", "ksh"),
1787        (".profile", "bash"),
1788        ("/etc/profile", "bash"),
1789        ("PKGBUILD", "bash"),
1790        (".tcshrc", "tcsh"),
1791        ("tcsh.login", "tcsh"),
1792        ("tcsh.tcshrc", "tcsh"),
1793        ("/etc/slp.conf", "slpconf"),
1794        ("/etc/slp.reg", "slpreg"),
1795        ("/etc/slp.spi", "slpspi"),
1796        (".slrnrc", "slrnrc"),
1797        ("sendmail.cf", "sm"),
1798        ("Snakefile", "snakemake"),
1799        (".sqlite_history", "sql"),
1800        ("squid.conf", "squid"),
1801        ("ssh_config", "sshconfig"),
1802        ("sshd_config", "sshdconfig"),
1803        ("/etc/sudoers", "sudoers"),
1804        ("sudoers.tmp", "sudoers"),
1805        ("/etc/sysctl.conf", "sysctl"),
1806        ("tags", "tags"),
1807        ("pending.data", "taskdata"),
1808        ("completed.data", "taskdata"),
1809        ("undo.data", "taskdata"),
1810        (".tclshrc", "tcl"),
1811        (".wishrc", "tcl"),
1812        (".tclsh-history", "tcl"),
1813        ("tclsh.rc", "tcl"),
1814        (".xsctcmdhistory", "tcl"),
1815        (".xsdbcmdhistory", "tcl"),
1816        ("texmf.cnf", "texmf"),
1817        ("COPYING", "text"),
1818        // TODO: could be haredoc
1819        ("README", "text"),
1820        ("LICENSE", "text"),
1821        ("AUTHORS", "text"),
1822        ("tfrc", "tf"),
1823        (".tfrc", "tf"),
1824        ("tidy.conf", "tidy"),
1825        ("tidyrc", "tidy"),
1826        (".tidyrc", "tidy"),
1827        (".tmux.conf", "tmux"),
1828        ("Cargo.lock", "toml"),
1829        ("/.cargo/config", "toml"),
1830        ("/.cargo/credentials", "toml"),
1831        ("Pipfile", "toml"),
1832        ("Gopkg.lock", "toml"),
1833        ("uv.lock", "toml"),
1834        (".black", "toml"),
1835        // TODO: could be toml
1836        ("black", ""),
1837        ("trustees.conf", "trustees"),
1838        (".ts_node_repl_history", "typescript"),
1839        ("/etc/udev/udev.conf", "udevconf"),
1840        ("/etc/updatedb.conf", "updatedb"),
1841        ("fdrupstream.log", "upstreamlog"),
1842        ("vgrindefs", "vgrindefs"),
1843        (".exrc", "vim"),
1844        ("_exrc", "vim"),
1845        (".netrwhist", "vim"),
1846        ("_viminfo", "viminfo"),
1847        (".viminfo", "viminfo"),
1848        (".wgetrc", "wget"),
1849        (".wget2rc", "wget2"),
1850        ("wgetrc", "wget"),
1851        ("wget2rc", "wget2"),
1852        (".wvdialrc", "wvdial"),
1853        ("wvdial.conf", "wvdial"),
1854        (".XCompose", "xcompose"),
1855        ("Compose", "xcompose"),
1856        (".Xresources", "xdefaults"),
1857        (".Xpdefaults", "xdefaults"),
1858        ("xdm-config", "xdefaults"),
1859        (".Xdefaults", "xdefaults"),
1860        ("xorg.conf", "xf86conf"),
1861        ("xorg.conf-4", "xf86conf"),
1862        ("XF86Config", "xf86conf"),
1863        ("/etc/xinetd.conf", "xinetd"),
1864        ("fglrxrc", "xml"),
1865        ("/etc/blkid.tab", "xml"),
1866        ("/etc/blkid.tab.old", "xml"),
1867        ("fonts.conf", "xml"),
1868        ("Directory.Packages.props", "xml"),
1869        ("Directory.Build.props", "xml"),
1870        ("Directory.Build.targets", "xml"),
1871        (".clangd", "yaml"),
1872        (".clang-format", "yaml"),
1873        (".clang-tidy", "yaml"),
1874        ("pixi.lock", "yaml"),
1875        ("yarn.lock", "yaml"),
1876        ("matplotlibrc", "yaml"),
1877        (".condarc", "yaml"),
1878        ("condarc", "yaml"),
1879        ("zathurarc", "zathurarc"),
1880        ("/etc/zprofile", "zsh"),
1881        (".zlogin", "zsh"),
1882        (".zlogout", "zsh"),
1883        (".zshrc", "zsh"),
1884        (".zprofile", "zsh"),
1885        (".zcompdump", "zsh"),
1886        (".zsh_history", "zsh"),
1887        (".zshenv", "zsh"),
1888        (".zfbfmarks", "zsh"),
1889    ])
1890});
1891
1892static PATTERNS: LazyLock<(RegexSet, Vec<&str>)> = LazyLock::new(|| {
1893    let home = var("HOME");
1894    let xdg_config_home = var("XDG_CONFIG_HOME");
1895    let gnupghome = var("GNUPGHOME");
1896
1897    let maps = [
1898        ("/debian/changelog$", "debchangelog"),
1899        ("/debian/control$", "debcontrol"),
1900        ("/debian/copyright$", "debcopyright"),
1901        // TODO: nil-ing i guess?
1902        ("/debian/patches/", "dep3patch"),
1903        (r"/etc/a2ps\.cfg$", "a2ps"),
1904        (r"/etc/a2ps/.*\.cfg$", "a2ps"),
1905        ("/etc/aliases$", "mailaliases"),
1906        // TODO: whatever the hell starsetf is
1907        (r"/etc/apache2/conf\..*/", "apache"),
1908        (r"/etc/apache2/.*\.conf", "apache"),
1909        (r"/etc/apache2/mods\..*/", "apache"),
1910        (r"/etc/apache2/sites\..*/.*\.com$", "apache"),
1911        (r"/etc/apache2/sites\..*/", "apache"),
1912        (r"/etc/apt/sources\.list$", "debsources"),
1913        (r"/etc/apt/sources\.list\.d/.*\.list$", "debsources"),
1914        (r"/etc/apt/sources\.list\.d/.*\.sources$", "deb822sources"),
1915        (r"/etc/asound\.conf$", "alsaconf"),
1916        (r"/etc/blkid\.tab$", "xml"),
1917        (r"/etc/blkid\.tab\.old$", "xml"),
1918        (r"/etc/cdrdao\.conf$", "cdrdaoconf"),
1919        // TODO: nil-ing i guess?
1920        ("/etc/config/", "uci"),
1921        (r"/etc/conf\.modules$", "modconf"),
1922        // TODO: whatever the hell starsetf is
1923        (r"/etc/cron\.d/", "crontab"),
1924        ("/etc/default/cdrdao$", "cdrdaoconf"),
1925        ("/etc/defaults/cdrdao$", "cdrdaoconf"),
1926        ("/etc/DIR_COLORS$", "dircolors"),
1927        (r"/etc/dnsmasq\.conf$", "dnsmasq"),
1928        // TODO: whatever the hell starsetf is
1929        (r"/etc/dnsmasq\.d/", "dnsmasq"),
1930        ("/etc/gitattributes$", "gitattributes"),
1931        ("/etc/gitconfig$", "gitconfig"),
1932        // TODO: whatever the hell starsetf is
1933        (r"/etc/gitconfig\.d/", "gitconfig"),
1934        (r"/etc/group\.$", "group"),
1935        ("/etc/group$", "group"),
1936        (r"/etc/group\.edit$", "group"),
1937        (r"/etc/grub\.conf$", "grub"),
1938        (r"/etc/gshadow\.$", "group"),
1939        ("/etc/gshadow$", "group"),
1940        (r"/etc/gshadow\.edit$", "group"),
1941        (r"/etc/host\.conf$", "hostconf"),
1942        // TODO: whatever the hell starsetf is
1943        (r"/etc/hostname\.", "config"),
1944        (r"/etc/hosts\.allow$", "hostsaccess"),
1945        (r"/etc/hosts\.deny$", "hostsaccess"),
1946        (r"/etc/httpd/.*\.conf$", "apache"),
1947        (r"/etc/httpd/conf\.d/.*\.conf", "apache"),
1948        (r"/etc/httpd/conf\..*/", "apache"),
1949        (r"/etc/httpd/mods\..*/", "apache"),
1950        (r"/etc/httpd/sites\..*/", "apache"),
1951        (r"/etc/init/.*\.conf$", "upstart"),
1952        (r"/etc/initng/.*/.*\.i$", "initng"),
1953        (r"/etc/init/.*\.override$", "upstart"),
1954        (r"/etc/libao\.conf$", "libao"),
1955        ("/etc/limits$", "limits"),
1956        (r"/etc/.*limits\.conf$", "limits"),
1957        (r"/etc/.*limits\.d/.*\.conf$", "limits"),
1958        // TODO: whatever the hell starsetf is
1959        (r"/etc/logcheck/.*\.d.*/", "logcheck"),
1960        (r"/etc/login\.access$", "loginaccess"),
1961        (r"/etc/login\.defs$", "logindefs"),
1962        ("/etc/mail/aliases$", "mailaliases"),
1963        (r"/etc/man\.conf$", "manconf"),
1964        // TODO: whatever the hell starsetf is
1965        (r"/etc/modprobe\.", "modconf"),
1966        ("/etc/modules$", "modconf"),
1967        (r"/etc/modules\.conf$", "modconf"),
1968        // TODO: nil-ing i guess?
1969        ("/etc/modutils/", "modconf"),
1970        // TODO: whatever the hell starsetf is
1971        (r"/etc/Muttrc\.d/", "muttrc"),
1972        ("/etc/nanorc$", "nanorc"),
1973        ("/etc/nginx/", "nginx"),
1974        (r"/etc/pam\.conf$", "pamconf"),
1975        // TODO: whatever the hell starsetf is
1976        (r"/etc/pam\.d/", "pamconf"),
1977        (r"/etc/passwd\.$", "passwd"),
1978        ("/etc/passwd$", "passwd"),
1979        (r"/etc/passwd\.edit$", "passwd"),
1980        ("/etc/pinforc$", "pinfo"),
1981        ("/etc/profile$", "bash"),
1982        // TODO: whatever the hell starsetf is
1983        (r"/etc/proftpd/.*\.conf", "apachestyle"),
1984        (r"/etc/proftpd/conf\..*/", "apachestyle"),
1985        ("/etc/protocols$", "protocols"),
1986        (r"/etc/sensors3\.conf$", "sensors"),
1987        (r"/etc/sensors\.conf$", "sensors"),
1988        // TODO: whatever the hell starsetf is
1989        (r"/etc/sensors\.d/[^.]", "sensors"),
1990        (r"/etc/serial\.conf$", "setserial"),
1991        ("/etc/services$", "services"),
1992        (r"/etc/shadow\.$", "passwd"),
1993        ("/etc/shadow$", "passwd"),
1994        (r"/etc/shadow\.edit$", "passwd"),
1995        (r"/etc/slp\.conf$", "slpconf"),
1996        (r"/etc/slp\.reg$", "slpreg"),
1997        (r"/etc/slp\.spi$", "slpspi"),
1998        (r"/etc/ssh/ssh_config\.d/.*\.conf$", "sshconfig"),
1999        (r"/etc/ssh/sshd_config\.d/.*\.conf$", "sshdconfig"),
2000        ("/etc/sudoers$", "sudoers"),
2001        // TODO: whatever the hell starsetf is
2002        (r"/etc/sudoers\.d/", "sudoers"),
2003        (r"/etc/sysctl\.conf$", "sysctl"),
2004        (r"/etc/sysctl\.d/.*\.conf$", "sysctl"),
2005        (r"/etc/systemd/.*\.conf\.d/.*\.conf$", "systemd"),
2006        (r"/etc/systemd/system/.*\.d/.*\.conf$", "systemd"),
2007        (r"/etc/systemd/system/.*\.d/\.#", "systemd"),
2008        (r"/etc/systemd/system/\.#", "systemd"),
2009        (r"/etc/translate\.shell$", "clojure"),
2010        (r"/etc/udev/cdsymlinks\.conf$", "sh"),
2011        (r"/etc/udev/permissions\.d/.*\.permissions$", "udevperm"),
2012        (r"/etc/udev/udev\.conf$", "udevconf"),
2013        (r"/etc/updatedb\.conf$", "updatedb"),
2014        (r"/etc/xdg/menus/.*\.menu$", "xml"),
2015        (r"/etc/xinetd\.conf$", "xinetd"),
2016        // TODO: whatever the hell starsetf is
2017        (r"/etc/xinetd\.d/", "xinetd"),
2018        (r"/etc/yum\.conf$", "dosini"),
2019        // TODO: whatever the hell starsetf is
2020        (r"/etc/yum\.repos\.d/", "dosini"),
2021        ("/etc/zprofile$", "zsh"),
2022        (r"/log/auth\.crit$", "messages"),
2023        (r"/log/auth\.err$", "messages"),
2024        (r"/log/auth\.info$", "messages"),
2025        (r"/log/auth\.log$", "messages"),
2026        (r"/log/auth\.notice$", "messages"),
2027        (r"/log/auth\.warn$", "messages"),
2028        ("/log/auth$", "messages"),
2029        (r"/log/cron\.crit$", "messages"),
2030        (r"/log/cron\.err$", "messages"),
2031        (r"/log/cron\.info$", "messages"),
2032        (r"/log/cron\.log$", "messages"),
2033        (r"/log/cron\.notice$", "messages"),
2034        (r"/log/cron\.warn$", "messages"),
2035        ("/log/cron$", "messages"),
2036        (r"/log/daemon\.crit$", "messages"),
2037        (r"/log/daemon\.err$", "messages"),
2038        (r"/log/daemon\.info$", "messages"),
2039        (r"/log/daemon\.log$", "messages"),
2040        (r"/log/daemon\.notice$", "messages"),
2041        (r"/log/daemon\.warn$", "messages"),
2042        ("/log/daemon$", "messages"),
2043        (r"/log/debug\.crit$", "messages"),
2044        (r"/log/debug\.err$", "messages"),
2045        (r"/log/debug\.info$", "messages"),
2046        (r"/log/debug\.log$", "messages"),
2047        (r"/log/debug\.notice$", "messages"),
2048        (r"/log/debug\.warn$", "messages"),
2049        ("/log/debug$", "messages"),
2050        (r"/log/kern\.crit$", "messages"),
2051        (r"/log/kern\.err$", "messages"),
2052        (r"/log/kern\.info$", "messages"),
2053        (r"/log/kern\.log$", "messages"),
2054        (r"/log/kern\.notice$", "messages"),
2055        (r"/log/kern\.warn$", "messages"),
2056        ("/log/kern$", "messages"),
2057        (r"/log/lpr\.crit$", "messages"),
2058        (r"/log/lpr\.err$", "messages"),
2059        (r"/log/lpr\.info$", "messages"),
2060        (r"/log/lpr\.log$", "messages"),
2061        (r"/log/lpr\.notice$", "messages"),
2062        (r"/log/lpr\.warn$", "messages"),
2063        ("/log/lpr$", "messages"),
2064        (r"/log/mail\.crit$", "messages"),
2065        (r"/log/mail\.err$", "messages"),
2066        (r"/log/mail\.info$", "messages"),
2067        (r"/log/mail\.log$", "messages"),
2068        (r"/log/mail\.notice$", "messages"),
2069        (r"/log/mail\.warn$", "messages"),
2070        ("/log/mail$", "messages"),
2071        (r"/log/messages\.crit$", "messages"),
2072        (r"/log/messages\.err$", "messages"),
2073        (r"/log/messages\.info$", "messages"),
2074        (r"/log/messages\.log$", "messages"),
2075        (r"/log/messages\.notice$", "messages"),
2076        (r"/log/messages\.warn$", "messages"),
2077        ("/log/messages$", "messages"),
2078        (r"/log/news/news\.crit$", "messages"),
2079        (r"/log/news/news\.err$", "messages"),
2080        (r"/log/news/news\.info$", "messages"),
2081        (r"/log/news/news\.log$", "messages"),
2082        (r"/log/news/news\.notice$", "messages"),
2083        (r"/log/news/news\.warn$", "messages"),
2084        ("/log/news/news$", "messages"),
2085        (r"/log/syslog\.crit$", "messages"),
2086        (r"/log/syslog\.err$", "messages"),
2087        (r"/log/syslog\.info$", "messages"),
2088        (r"/log/syslog\.log$", "messages"),
2089        (r"/log/syslog\.notice$", "messages"),
2090        (r"/log/syslog\.warn$", "messages"),
2091        ("/log/syslog$", "messages"),
2092        (r"/log/user\.crit$", "messages"),
2093        (r"/log/user\.err$", "messages"),
2094        (r"/log/user\.info$", "messages"),
2095        (r"/log/user\.log$", "messages"),
2096        (r"/log/user\.notice$", "messages"),
2097        (r"/log/user\.warn$", "messages"),
2098        ("/log/user$", "messages"),
2099        (r"/\.config/systemd/user/\.#", "systemd"),
2100        (r"/\.config/systemd/user/.*\.d/\.#", "systemd"),
2101        (r"/\.config/systemd/user/.*\.d/.*\.conf$", "systemd"),
2102        (r"/systemd/.*\.automount$", "systemd"),
2103        (r"/systemd/.*\.dnssd$", "systemd"),
2104        (r"/systemd/.*\.link$", "systemd"),
2105        (r"/systemd/.*\.mount$", "systemd"),
2106        (r"/systemd/.*\.netdev$", "systemd"),
2107        (r"/systemd/.*\.network$", "systemd"),
2108        (r"/systemd/.*\.nspawn$", "systemd"),
2109        (r"/systemd/.*\.path$", "systemd"),
2110        (r"/systemd/.*\.service$", "systemd"),
2111        (r"/systemd/.*\.slice$", "systemd"),
2112        (r"/systemd/.*\.socket$", "systemd"),
2113        (r"/systemd/.*\.swap$", "systemd"),
2114        (r"/systemd/.*\.target$", "systemd"),
2115        (r"/systemd/.*\.timer$", "systemd"),
2116        (r"/usr/share/alsa/alsa\.conf$", "alsaconf"),
2117        (r"/usr/.*/gnupg/options\.skel$", "gpg"),
2118        (r"/usr/share/upstart/.*\.conf$", "upstart"),
2119        (r"/usr/share/upstart/.*\.override$", "upstart"),
2120        (r"/var/backups/group\.bak$", "group"),
2121        (r"/var/backups/gshadow\.bak$", "group"),
2122        (r"/var/backups/passwd\.bak$", "passwd"),
2123        (r"/var/backups/shadow\.bak$", "passwd"),
2124        (r"/\.aptitude/config$", "aptconf"),
2125        (r"/build/conf/.*\.conf$", "bitbake"),
2126        (r"/meta\..*/conf/.*\.conf$", "bitbake"),
2127        (r"/meta/conf/.*\.conf$", "bitbake"),
2128        (r"/project\.spec/configs/.*\.conf$", "bitbake"),
2129        (r"/\.cabal/config$", "cabalconfig"),
2130        ("/cabal/config$", "cabalconfig"),
2131        (r"/\.aws/config$", "confini"),
2132        ("/bpython/config$", "dosini"),
2133        ("/flatpak/repo/config$", "dosini"),
2134        ("/mypy/config$", "dosini"),
2135        (fmt!(r"^{home}/\.config/notmuch/.*/config$"), "dosini"),
2136        (fmt!("^{xdg_config_home}/notmuch/.*/config$"), "dosini"),
2137        (fmt!("^{xdg_config_home}/git/config$"), "gitconfig"),
2138        (r"\.git/config\.worktree$", "gitconfig"),
2139        (r"\.git/config$", "gitconfig"),
2140        (r"\.git/modules/.*/config$", "gitconfig"),
2141        (r"\.git/modules/config$", "gitconfig"),
2142        (r"\.git/worktrees/.*/config\.worktree$", "gitconfig"),
2143        (r"/\.config/git/config$", "gitconfig"),
2144        // TODO: whatever the hell starsetf is
2145        (r"/gitolite\.admin/conf/", "gitolite"),
2146        (r"/\.i3/config$", "i3config"),
2147        ("/i3/config$", "i3config"),
2148        (r"/\.mplayer/config$", "mplayerconf"),
2149        ("/supertux2/config$", "scheme"),
2150        (r"/neofetch/config\.conf$", "sh"),
2151        (r"/\.ssh/config$", "sshconfig"),
2152        (r"/\.sway/config$", "swayconfig"),
2153        ("/sway/config$", "swayconfig"),
2154        (r"/\.cargo/config$", "toml"),
2155        (r"/\.bundle/config$", "yaml"),
2156        (r"/\.kube/config$", "yaml"),
2157        (r"/\.aws/credentials$", "confini"),
2158        // TODO: whatever the hell starsetf is
2159        (r"/\.gitconfig\.d/", "gitconfig"),
2160        (r"/\.gnupg/gpg\.conf$", "gpg"),
2161        (r"/\.gnupg/options$", "gpg"),
2162        (r"/\.icewm/menu$", "icemenu"),
2163        (r"/\.libao$", "libao"),
2164        (r"/\.pinforc$", "pinfo"),
2165        (r"/\.cargo/credentials$", "toml"),
2166        (r"/\.init/.*\.override$", "upstart"),
2167        // TODO: whatever the hell starsetf is
2168        (r"/\.calendar/", "calendar"),
2169        (r"/share/calendar/.*/calendar\.", "calendar"),
2170        (r"/share/calendar/calendar\.", "calendar"),
2171        (r"/\.?cmus/.*\.theme$", "cmusrc"),
2172        (r"/\.?cmus/rc$", "cmusrc"),
2173        (r"/\.cmus/autosave$", "cmusrc"),
2174        (r"/\.cmus/command\.history$", "cmusrc"),
2175        // TODO: nil-ing i guess?
2176        (r"\.git/", "git"),
2177        (fmt!("^{xdg_config_home}/git/attributes$"), "gitattributes"),
2178        (r"\.git/info/attributes$", "gitattributes"),
2179        (r"/\.config/git/attributes$", "gitattributes"),
2180        (fmt!("^{xdg_config_home}/git/ignore$"), "gitignore"),
2181        (r"\.git/info/exclude$", "gitignore"),
2182        (r"/\.config/git/ignore$", "gitignore"),
2183        (r"enlightenment/.*\.cfg$", "c"),
2184        (r"Eterm/.*\.cfg$", "eterm"),
2185        (r"baseq[2-3/.*\.cfg$]", "quake"),
2186        (r"id1/.*\.cfg$", "quake"),
2187        (r"quake[1-3/.*\.cfg$]", "quake"),
2188        (r"/tex/latex/.*\.cfg$", "tex"),
2189        // TODO: whatever the hell starsetf is
2190        (r"^proftpd\.conf", "apachestyle"),
2191        (r"^access\.conf", "apache"),
2192        (r"^apache\.conf", "apache"),
2193        (r"^apache2\.conf", "apache"),
2194        (r"^httpd\.conf", "apache"),
2195        (r"^httpd\..*\.conf", "apache"),
2196        (r"^proxy\.html\.conf", "apache"),
2197        (r"^srm\.conf", "apache"),
2198        // TODO: whatever the hell starsetf is
2199        (r"asterisk/.*\.conf", "asterisk"),
2200        // TODO: whatever the hell starsetf is
2201        (r"asterisk.*/.*voicemail\.conf", "asteriskvm"),
2202        (r"^dictd.*\.conf$", "dictdconf"),
2203        (r"/\.?gnuradio/.*\.conf$", "confini"),
2204        (r"/gnuradio/conf\.d/.*\.conf$", "confini"),
2205        (r"/lxqt/.*\.conf$", "dosini"),
2206        (r"/screengrab/.*\.conf$", "dosini"),
2207        (r"/\.config/fd/ignore$", "gitignore"),
2208        (fmt!(r"^{gnupghome}/gpg\.conf$"), "gpg"),
2209        (r"/boot/grub/grub\.conf$", "grub"),
2210        (r"/hypr/.*\.conf$", "hyprlang"),
2211        // TODO: whatever the hell starsetf is
2212        (r"^lilo\.conf", "lilo"),
2213        (r"^named.*\.conf$", "named"),
2214        (r"^rndc.*\.conf$", "named"),
2215        (r"/openvpn/.*/.*\.conf$", "openvpn"),
2216        (r"/pipewire/.*\.conf$", "spajson"),
2217        (r"/wireplumber/.*\.conf$", "spajson"),
2218        (r"/\.ssh/.*\.conf$", "sshconfig"),
2219        (r"^\.?tmux.*\.conf$", "tmux"),
2220        (r"^\.?tmux.*\.conf", "tmux"),
2221        (r"/containers/containers\.conf$", "toml"),
2222        (r"/containers/containers\.conf\.d/.*\.conf$", "toml"),
2223        (r"/containers/containers\.conf\.modules/.*\.conf$", "toml"),
2224        (r"/containers/registries\.conf$", "toml"),
2225        (r"/containers/registries\.conf\.d/.*\.conf$", "toml"),
2226        (r"/containers/storage\.conf$", "toml"),
2227        (r"/\.config/upstart/.*\.conf$", "upstart"),
2228        (r"/\.config/upstart/.*\.override$", "upstart"),
2229        (r"/\.init/.*\.conf$", "upstart"),
2230        (r"/xorg\.conf\.d/.*\.conf$", "xf86conf"),
2231        (r"\.\.sst\.meta$", "sisu"),
2232        (r"\._sst\.meta$", "sisu"),
2233        (r"\.sst\.meta$", "sisu"),
2234        // TODO: Whatever the hell starsetf is
2235        (r"^Containerfile\.", "dockerfile"),
2236        (r"^Dockerfile\.", "dockerfile"),
2237        ("[mM]akefile$", "make"),
2238        // TODO: Whatever the hell starsetf is
2239        ("^[mM]akefile", "make"),
2240        // TODO: Whatever the hell starsetf is
2241        ("^[rR]akefile", "ruby"),
2242        (r"^\.profile", "bash"),
2243        // TODO: Whatever the hell starsetf is
2244        (r"/\.fvwm/", "fvwm"),
2245        ("fvwmrc", "fvwm"),
2246        (r"fvwm95.*\.hook$", "fvwm"),
2247        // TODO: Could be fvwm2m4
2248        ("fvwm2rc", "fvwm"),
2249        (r"/nginx/.*\.conf$", "nginx"),
2250        ("/usr/local/nginx/conf/", "nginx"),
2251        (r"nginx\.conf$", "nginx"),
2252        (r"^nginx.*\.conf$", "nginx"),
2253        (r"\.requirements\.txt$", "requirements"),
2254        (r"^requirements/.*\.txt$", "requirements"),
2255        (r"^requires/.*\.txt$", "requirements"),
2256        ("s6.*/down$", "execline"),
2257        ("s6.*/finish$", "execline"),
2258        ("s6.*/run$", "execline"),
2259        ("s6.*/up$", "execline"),
2260        (r"^s6\.", "execline"),
2261        (r"^mutt\..*\.\.+$", "mail"),
2262        (r"^mutt[\._-]{6}$", "mail"),
2263        (r"^muttng\..*\.\.+$", "mail"),
2264        (r"^neomutt\..*\.\.+$", "mail"),
2265        (r"^neomutt[\._-]$", "mail"),
2266        // TODO: Whatever the hell starsetf is
2267        (r"^\.?muttngrc", "muttrc"),
2268        (r"^\.?muttrc", "muttrc"),
2269        (r"/\.mutt/muttrc", "muttrc"),
2270        (r"/\.muttng/muttngrc", "muttrc"),
2271        (r"/\.muttng/muttrc", "muttrc"),
2272        ("^Muttngrc", "muttrc"),
2273        ("^Muttrc", "muttrc"),
2274        // TODO: Whatever the hell starsetf is
2275        (r"^\.?neomuttrc", "neomuttrc"),
2276        (r"/\.neomutt/neomuttrc", "neomuttrc"),
2277        ("^Neomuttrc", "neomuttrc"),
2278        (r"\.neomuttdebug", "neomuttlog"),
2279        // TODO: Whatever the hell starsetf is
2280        (r"/\.?xkb/compat/", "xkb"),
2281        (r"/\.?xkb/geometry/", "xkb"),
2282        (r"/\.?xkb/keycodes/", "xkb"),
2283        (r"/\.?xkb/symbols/", "xkb"),
2284        (r"/\.?xkb/types/", "xkb"),
2285        (r"/m17n/.*\.ali$", "m17ndb"),
2286        (r"/m17n/.*\.cs$", "m17ndb"),
2287        (r"/m17n/.*\.dir$", "m17ndb"),
2288        (r"/m17n/.*\.flt$", "m17ndb"),
2289        (r"/m17n/.*\.fst$", "m17ndb"),
2290        (r"/m17n/.*\.lnm$", "m17ndb"),
2291        (r"/m17n/.*\.mic$", "m17ndb"),
2292        (r"/m17n/.*\.mim$", "m17ndb"),
2293        (r"/m17n/.*\.tbl$", "m17ndb"),
2294        (r"/\.m17n\.d/.*\.ali$", "m17ndb"),
2295        (r"/\.m17n\.d/.*\.cs$", "m17ndb"),
2296        (r"/\.m17n\.d/.*\.dir$", "m17ndb"),
2297        (r"/\.m17n\.d/.*\.flt$", "m17ndb"),
2298        (r"/\.m17n\.d/.*\.fst$", "m17ndb"),
2299        (r"/\.m17n\.d/.*\.lnm$", "m17ndb"),
2300        (r"/\.m17n\.d/.*\.mic$", "m17ndb"),
2301        (r"/\.m17n\.d/.*\.mim$", "m17ndb"),
2302        (r"/\.m17n\.d/.*\.tbl$", "m17ndb"),
2303        (r"/m17n\.db/.*\.ali$", "m17ndb"),
2304        (r"/m17n\.db/.*\.cs$", "m17ndb"),
2305        (r"/m17n\.db/.*\.dir$", "m17ndb"),
2306        (r"/m17n\.db/.*\.flt$", "m17ndb"),
2307        (r"/m17n\.db/.*\.fst$", "m17ndb"),
2308        (r"/m17n\.db/.*\.lnm$", "m17ndb"),
2309        (r"/m17n\.db/.*\.mic$", "m17ndb"),
2310        (r"/m17n\.db/.*\.mim$", "m17ndb"),
2311        (r"/m17n\.db/.*\.tbl$", "m17ndb"),
2312        (r"^\.cshrc", "csh"),
2313        (r"^\.login", "csh"),
2314        (r"^\.notmuch\.config\.", "dosini"),
2315        (r"^\.gitsendemail\.msg\.......$", "gitsendemail"),
2316        (r"^\.kshrc", "ksh"),
2317        (r"^\.article\.\.+$", "mail"),
2318        (r"^\.letter\.\.+$", "mail"),
2319        (r"^\.reminders", "remind"),
2320        (r"^\.tcshrc", "tcsh"),
2321        (r"^\.zcompdump", "zsh"),
2322        (r"\.csproj\.user$", "xml"),
2323        (r"\.fsproj\.user$", "xml"),
2324        (r"\.vbproj\.user$", "xml"),
2325        (r"^bash\.fc[\-\.]", "bash"),
2326        (r"/bind/db\.", "bindzone"),
2327        (r"/named/db\.", "bindzone"),
2328        (r"\.blade\.php$", "blade"),
2329        (r"^bzr_log\.", "bzr"),
2330        // TODO: Whatever the hell starsetf is
2331        (r"^cabal\.project\.", "cabalproject"),
2332        (r"^sgml\.catalog", "catalog"),
2333        ("hgrc$", "cfg"),
2334        // TODO: Could be debchangelog
2335        ("^[cC]hange[lL]og", "changelog"),
2336        (r"\.\.ch$", "chill"),
2337        (r"\.cmake\.in$", "cmake"),
2338        // TODO: Whatever the hell starsetf is
2339        (r"^crontab\.", "crontab"),
2340        (r"^cvs\.+$", "cvs"),
2341        ("/DEBIAN/control$", "debcontrol"),
2342        (r"^php\.ini\.", "dosini"),
2343        (r"^php\.fpm\.conf", "dosini"),
2344        (r"^www\.conf", "dosini"),
2345        // TODO: Whatever the hell starsetf is
2346        (r"^drac\.", "dracula"),
2347        (r"/dtrace/.*\.d$", "dtrace"),
2348        ("esmtprc$", "esmtprc"),
2349        (r"/0\.orig/", "foam"),
2350        ("/0/", "foam"),
2351        ("/constant/g$", "foam"),
2352        (r"Transport\.", "foam"),
2353        (r"^[a-zA-Z0-9].*Dict\.", "foam"),
2354        ("^[a-zA-Z0-9].*Dict$", "foam"),
2355        (r"^[a-zA-Z].*Properties\.", "foam"),
2356        ("^[a-zA-Z].*Properties$", "foam"),
2357        // TODO: Whatever the hell starsetf is
2358        ("/tmp/lltmp", "gedcom"),
2359        ("^gkrellmrc_.$", "gkrellmrc"),
2360        (fmt!("^{gnupghome}/options$"), "gpg"),
2361        (r"/boot/grub/menu\.lst$", "grub"),
2362        // TODO: Whatever the hell starsetf is
2363        (r"^\.?gtkrc", "gtkrc"),
2364        // (r"/doc/.*\.txt$", function(_, bufnr))
2365        //   local line, M._getline(bufnr, -1)
2366        //   if
2367        //     M._findany(line, {
2368        //       (r"^vim:ft=help[:\.]"),
2369        //       ("^vim:ft=help$"),
2370        //       (r"^vim:filetype=help[:\.]"),
2371        //       ("^vim:filetype=help$"),
2372        //       (r"^vim:.*[:\.]ft=help[:\.]"),
2373        //       (r"^vim:.*[:\.]ft=help$"),
2374        //       (r"^vim:.*[:\.]filetype=help[:\.]"),
2375        //       (r"^vim:.*[:\.]filetype=help$"),
2376        //       (r"\.vim:ft=help[:\.]"),
2377        //       (r"\.vim:ft=help$"),
2378        //       (r"\.vim:filetype=help[:\.]"),
2379        //       (r"\.vim:filetype=help$"),
2380        //       (r"\.vim:.*[:\.]ft=help[:\.]"),
2381        //       (r"\.vim:.*[:\.]ft=help$"),
2382        //       (r"\.vim:.*[:\.]filetype=help[:\.]"),
2383        //       (r"\.vim:.*[:\.]filetype=help$"),
2384        //     })
2385        //   then
2386        //     return "help"
2387        //   end
2388        // end,
2389        (r"^hg\.editor\..*\.txt$", "hgcommit"),
2390        (r"\.html\.m4$", "htmlm4"),
2391        // TODO: Whatever the hell starsetf is
2392        (r"^JAM.*\.", "jam"),
2393        (r"^Prl.*\.", "jam"),
2394        (fmt!(r"^{home}/.*/Code/User/.*\.json$"), "jsonc"),
2395        (fmt!(r"^{home}/.*/VSCodium/User/.*\.json$"), "jsonc"),
2396        (r"\.properties_..$", "jproperties"),
2397        (r"\.properties_.._..$", "jproperties"),
2398        // TODO: Whatever the hell starsetf is
2399        (r"\.properties_.._.._", "jproperties"),
2400        (r"^org\.eclipse\..*\.prefs$", "jproperties"),
2401        (r"^[jt]sconfig.*\.json$", "jsonc"),
2402        // TODO: Whatever the hell starsetf is
2403        (r"^Config\.in\.", "kconfig"),
2404        (r"^Kconfig\.", "kconfig"),
2405        ("/ldscripts/", "ld"),
2406        ("lftp/rc$", "lftp"),
2407        (r"/LiteStep/.*/.*\.rc$", "litestep"),
2408        (r"^/tmp/SLRN[0-9A-Z\.]+$", "mail"),
2409        (r"^ae\.+\.txt$", "mail"),
2410        (r"^pico\.\.+$", "mail"),
2411        // TODO: Whatever the hell starsetf is
2412        (r"^reportbug\.", "mail"),
2413        (r"^snd\.\.+$", "mail"),
2414        (r"^rndc.*\.key$", "named"),
2415        // TODO: Whatever the hell starsetf is
2416        (r"^tmac\.", "nroff"),
2417        (r"\.ml\.cppo$", "ocaml"),
2418        (r"\.mli\.cppo$", "ocaml"),
2419        ("/octave/history$", "octave"),
2420        (r"\.opam\.locked$", "opam"),
2421        (r"\.opam\.template$", "opam"),
2422        (r"^pacman\.log", "pacmanlog"),
2423        // ("printcap", starsetf(function(path, bufnr))
2424        //   return require("vim.filetype.detect").printcap("print")
2425        // end),
2426        (r"/queries/.*\.scm$", "query"),
2427        (",v$", "rcs"),
2428        (r"^svn\.commit.*\.tmp$", "svn"),
2429        (r"\.swift\.gyb$", "swiftgyb"),
2430        // ("termcap", starsetf(function(path, bufnr))
2431        //   return require("vim.filetype.detect").printcap("term")
2432        // end),
2433        (r"\.t\.html$", "tilde"),
2434        // TODO: Whatever the hell starsetf is
2435        (r"\.vhdl_[0-9]", "vhdl"),
2436        // TODO: Whatever the hell starsetf is
2437        ("vimrc", "vim"),
2438        // TODO: Whatever the hell starsetf is
2439        ("/Xresources/", "xdefaults"),
2440        (r"/app\.defaults/", "xdefaults"),
2441        ("^Xresources", "xdefaults"),
2442        (r"^XF86Config\.4", "xf86conf"),
2443        ("^XF86Config", "xf86conf"),
2444        ("Xmodmap$", "xmodmap"),
2445        // TODO: Whatever the hell starsetf is
2446        ("xmodmap", "xmodmap"),
2447        // TODO: Whatever the hell starsetf is
2448        (r"^\.?zlog", "zsh"),
2449        (r"^\.?zsh", "zsh"),
2450        // ("~$", function(path, bufnr))
2451        //   local short, path:gsub("~+$", "", 1)
2452        //   if path ~= short and short ~= "" then
2453        //     return M.match({ buf, bufnr, filename, fn.fnameescape(short) })
2454        //   end
2455        // end,
2456    ];
2457
2458    (
2459        RegexSet::new(maps.iter().map(|(pat, _)| *pat)).unwrap(),
2460        Vec::from_iter(maps.iter().map(|(_, lang)| *lang)),
2461    )
2462});
2463
2464fn var(str: &str) -> String {
2465    std::env::var(str).unwrap_or_default()
2466}
2467
2468macro fmt($($tt:tt)*) {{
2469    let str: &'static str = format!($($tt)*).leak();
2470    str
2471}}