filetypes.conf(5)

πŸ“¦
version 4.21 Β· 2 versions
  • 4.21 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 3.60 Β· centos-stream 9
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– filetypes.conf(5) πŸ’–

okay bestie, pull up a chair, because this is the manual page for filetypes.conf β€” the file type configuration of highlight. ✨


🌸 NAME 🌸

filetypes.conf β€” the file type configuration of highlight πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So like, this config file is where you keep your filename extensions and your shebang patterns, and it maps them to highlight's syntax definitions. That's the whole vibe. πŸ’…

If there's only one extension for a language, you literally don't need to do anything here β€” just name the lang file accordingly and it will work. No entry needed in this file. Iconic behaviour tbh. ✨

🫢 heads up: the filetype entries in gui_files/ext/fileopenfilter.conf should also be updated. Don't forget her, she gets jealous.

Extensions can be configured for multiple languages, no cap. Look at "asm" β€” she's assigned to both assembler and fasm. Multitasking queen. πŸ‘‘

Now, the command line (CLI) and the Qt GUI builds handle ambiguous assignments very differently, and this is lowkey important:

  • CLI: the first association listed here will be used
  • GUI: a syntax selection prompt will be shown (it's asking you to choose, bestie, be nice)

If a filename has no extension by convention β€” like makefile β€” it may be added here anyway, or you can configure it as "Shebang". Either way works, do what feels right. πŸ’œ

Location: The first filetypes.conf found in a highlight search directory wins. First come, first served, no takebacks. πŸƒβ€β™€οΈπŸ’¨

And ngl, it's easily possible to enhance highlight's database of programming languages and colour themes β€” just peep the README file for the details. Go build your empire. 🌈


⭐ EXTENSION MAPPING EXAMPLE ⭐

{ Lang='purebasic',  Extensions={'pb', 'pbi'} }

look at her go, so clean, so organised ✨


🧚 SHEBANG MAPPING EXAMPLE 🧚

{ Lang='xml', Shebang=[[^\s*<\?xml\s+version='1.0'\s+[^(\?>)]*?>\s*$]] }

regex girlies rise up, this one's for you πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

Andre Simon <as@andre-simon.de> πŸ’–


πŸ’€ SEE ALSO πŸ’€


and that's the tea, bestie πŸ“ mwah πŸ’‹

This page came to you courtesy of Andre Simon, dated 2019-03-12, and it's part of the filetypes.conf(5) manual. slay, stay hydrated, and go map some file types πŸ’…βœ¨