CHA-MIME.TYPES(5)
π mime.types π
ok so bestie, this is the mime.types page from the File Formats Manual β aka CHA-MIME.TYPES(5) if you're being formal about it π
. Sit down, grab a boba, we're mapping file extensions to MIME types and it's gonna be iconic.
β¨ NAME β¨
mime.types β Chawan uses the mime.types file to map file extensions to MIME types (also known as Content-Type). periodt π
MIME types in turn are used by mailcap to decide how to present a certain file to you: display it as text, use an external viewer, save it, etc. β the whole vibe check of "what do I even do with this file". See cha-mailcap(5) for the deets on how that works, iykyk π«Ά
π Search path π
Chawan parses all mime.types files defined in external.mime-types. And when no mime.types file is found? No stress β the built-in MIME type associations get used instead π«
The default search path for mime.types files is literally:
$HOME/.mime.types:/etc/mime.types:/usr/etc/mime.types:/usr/local/etc/mime.types
no cap, that's the whole path, all four of them, separated by colons π
π Format π
So the mime.types file is just a list of whitespace-separated columns, bestie. Column one = the mime type. Every column after that? File extensions. Slay π¦
Lines starting with a hash character (#) are recognized as comments and get ignored β they're giving background character energy, nobody looks at them π
Example time:
# comment
application/x-example exmpl ex
So this mime.types file would register the file extensions exmpl and ex to be recognized as the mime type application/x-example. Obsessed, honestly π
π Note π
ok important, don't skip this part:
Chawan only uses mime.types files for finding mailcap entries β buffers use an internal mime.types file for content type detection instead. Two different things, bestie, don't mix them up π
The default mime.types file only includes file formats that buffers can handle, which is... rather limited, ngl (at the time of writing, 7 file formats). Seven. SEVEN. So it is highly recommended to configure at least one external mime.types file if you use mailcap. This is your sign, go do it π
π See also π
fr fr go set up an external mime.types file. your mailcap game will thank you π
ok bye bestie, that was the whole page β made with love from the File Formats Manual, filed under CHA-MIME.TYPES(5) π
β¨π
π¦ where this page comes from
- alpine 3.24: chawan-doc 0.4.4-r0 Β· Unlicense
- arch rolling: chawan 0.5.0-1 Β· Unlicense
- nixpkgs unstable: chawan 0.4.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms