zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.55k stars 2.9k forks source link

Support for learning new file associations #13616

Open brandondrew opened 3 months ago

brandondrew commented 3 months ago

Check for existing issues

Describe the feature

As mentioned in #13608, I would love to be able to use the .markdown file extension without having to press "Select Language" every time I open a markdown file that uses it. That issue requests the simplest solution (supporting that standard file extension out of the box) but this one requests a more general solution that would cover a lot more use cases.

What if selecting a language for an as-yet-unknown file extension could cause that extension to be remembered? That would not only solve my problem with .markdown but anyone else's for any file extension, including any that are not standard but used regularly by any given individual.

I could envision a few ways people might want to configure this to work, so having the ability to add an entry to the settings.json file could be useful:

I think that automatically setting it would be the simplest to implement and probably satisfy 98% of users.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

baldwindavid commented 3 months ago

Just noting that the explicit configuration option mentioned is already available via the file_types setting. https://zed.dev/docs/configuring-zed#file-types

JosephTLyons commented 3 months ago

I initially closed this, because we do have the setting, but we don't automatically set that setting, or prompt the user when you use the language picker, as you noted, so it makes sense to leave this open.