I was finally able to fix this by following this guide. The conclusion was essentially (all steps must be done with admin priviliges):
- Create
/usr/share/mime/packages/julia.xml(easiest way is to copy and rename one of the files in there). - Change the file contents to
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/julia">
<comment>Julia source code</comment>
<glob pattern="*.jl"/>
</mime-type>
</mime-info>
- Run
sudo update-mime-database /usr/share/mime
Sidenote: rust files also had the line
<sub-class-of type="text/plain"/>, which seems very correct. However, I could not make the association work when I included that line.
Sidenote 2: I was unable to get an icon for the extension to work, but that would have been nice.