How can I configure the filename → language association?

remotely related to this thread:

but going a little further, would there be a way to say something like

  • all the files ending in * should be opened by jupytext-notebook, while
  • all the other files ending in *.md should be opened my markdown-preview

which is what I’d really like to be able to do in the end…

given that the defaultViewers setting maps tools to languages, I guess what I’m looking after is a way to map file naming schemes to languages ?
or is that smarter than that, is there some shallow inspection of the file to kind-of guess the language ?

sorry for asking that many dumb questions…

following-up on my own question:

I can see in
that a DocRegistry instance has a _fileTypes field populated in my case with 27 entries for text, markdown, notebook, etc…

can I easily control that from some configuration file ?