On 4/5/25 3:09 PM, Darrell Anderson via tde-users wrote:
I don't know if this is a PEBKAC issue.
I seem to have a devilish time getting Kate to remember syntax highlighting of previously opened files.
I have Kate configured to remember meta information for 180 days.
I also notice that often Kate does not guess the correct syntax highlighting for what are obvious shell scripts. The shell scripts have correct declarations at the beginning of the script. I get the feeling the detection scheme is keying off of something other than '#!/bin/sh'.
What might I be doing incorrectly? Or where might I start troubleshooting?
Thanks.
Well...,
katepart/syntax isn't as brilliant as we would like. Most of the time is keys off the file extension and MIME types rather than parsing and looking for the command interpreter.
If you go to kate Settings->Editor->highlighting, you can use the drop down to select the highlighting you want and make sure the extension you are using is listing and the MIME type is correct x-shellscript.
You can create custom entries in the extension box. For example, Archlinux PKGBUILD files should be shown as bash scripts and highlighted accordingly. I've added "PKGBUILD*" to catch the name with any text following it (like if I add a "PKBBUILD-ver-1")
But beyond that, I don't believe the syntax used is saved as part of the metadata that contains info like the active line being edited, etc..