KATE - File Highlight setting not kept.


When editing new files, I set highlight type to script bash for systemd script named /etc/systemd/system/mysqld@.service, and set type to ini for mysql config file named /etc/my.cnf.

When I reopened these files, the highlight property is lost.

Any help is welcome.

Kate doesn’t store syntax highlighting on a per file basis, when an existing file is opened the highlighting to apply is based upon the file extension and/or mime type.

These are set (for syntax kate knows of) from: Settings -> Configure Kate -> Open/Save -> Modes & Filetypes.

I’ve not tried this with the example you gave, but I guess it would work :slight_smile:

Find the syntax highlighting you want applied, for example Scripts/Bash, then add the file extension of the file you wish to be recognised as such.

As systemd file have no extension I have to create a mime type for that kind of file. ?

So I have just to add *.cnf (mysql) in the definition Settings -> Configure Kate -> Open/Save -> Modes & Filetypes/configuration/INI files.?