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
Steps taken
In my
gedit
, from the top bar menu, I selectView
,Highlight mode...
and "Plain Text" is the default as shown below:Using the file name "test.sample" and pasting in a few lines of Matlab code it still stays as "Plain Text" format unless I force it to "Matlab" format.
After saving and exiting I performed
cp test.sample test.newbee
followed bygedit test.newbee
the default format is still "Plain Text".Next I created a new file using
gedit
callednoextention
. I typed a sentence, saved the new file and exited. Then I reopened the file usinggedit
and this is the result:Notice the bottom bar of gedit's window shows
Plain Text
option for highlighting.Summary
This was done under Ubuntu 16.04, Kernel 4.4.0-53.
I can confirm that
<property name="globs">*.m</property>
exists within/usr/share/gtksourceview-3.0/language-specs/matlab.lang
.Because I can't break my system like yours, unless we find something on your system to fix, I suggest reinstalling
gedit
after removing and purging all it's files withapt-get
.Particulars about my version: