I frequently work with text files that do not have an extension or which have a non-standard extension using Gedit (a .sample file for example, for which the mime type is not understood), and Gedit always defaults to Matlab syntax highlighting.
I'd like to set a default syntax highlighting of 'Plain Text' for these files. Is this possible?
Nano can do this, and a similar question for files with extensions is here. I'm looking for an answer that allows me to set a catch-all style of plain text for all types without an extension or not already found in /usr/share/gtksourceview-3.0/language-specs/as described here
Requested info:
- No local language spec file in
~/.local/share/gtksourceview-3.0/language-specs/ - Output of
file --mime-type -b <myfile>is correcttext/plain
will make gedit recognize the file as a bash shellscript, and other script files are recognized too, for example python scripts. I have never tweaked this feature, but I am using it with gedit, and in a similar way with geany. I think someone will come with a solution to you :-)
– sudodus Dec 28 '16 at 18:24/usr/share/gtksourceview-3.0/language-specs/mathlab.lang(or whatever the MathLab language file is exactly) to:<property name="globs">*</property>??? ;-) If that does the trick, I'll post a full answer... – Fabby Dec 30 '16 at 07:08<property name="globs">*.m</property>. If I remove the '.m' wouldn't that match everything (and use matlab highlighting for all files)? – Tom Brossman Dec 30 '16 at 13:48ll /.local/share/gtksourceview-3.0/language-specs/. (2) What is the output offile --mime-type -b yourfiles? – user.dz Jan 01 '17 at 09:30text/plain(with the file now open and Matlab highlighting). – Tom Brossman Jan 01 '17 at 11:00