Often I have to open header-files (with ending .h) in Kate. The default syntax-highlighting with which these files will be opened is always C++
. How could this be changed to Fortran
so that I don't have to switch manually?
Edit1:
I already added a *.h;
to the list of extensions in fortran.xml under
~/.kde/share/apps/katepart/syntax/
but this doesn't help. *.h;
is also included in several other XML
-files in the upper directory.
By the way: The priority in both files cpp.xml
and fortran.xml
is 9
.
Edit2:
I tested the modifications on the XML
-files always by restarting Kate with the same files. Here, I see no changes. But, if I close an re-open the same files, it works.
Best Answer
Kate is using now
~/.kde/share/config/katemoderc
From GUI: Kate menu → Settings → Configure Kate... → Editor Component → Open/Save → Modes & Filetypes
Select filetype:
Sources/Fortran
, add;*.h
to file extensions, raise priority from9
to15
(Should be ok, Max priority for.h
was inSources/C++
which is9
)Close then reopen the files.