I have files with extensions .txt, .sln and .csproj, they all have mime type text/plain. But they should be opened by different programs. .txt - by Vim, .sln and .csproj - by Rider. How can I achieve this?
1 Answer
Here is explained how to create custom MIME type based on the file extension. I had to change their solution as follows:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns=""> <mime-type type="text/solution"> <comment>Rider solution file</comment> <glob pattern="*.sln"/> </mime-type>
</mime-info>And add this file as rider.xml to /usr/share/mime/packages.
It works but still looks like a hack. Is there a cleaner way to achieve this?
2