0

I am using Kate 3.14.8 to edit various file types including Makefiles and Python scripts. Consider that I have the following directory structure and files created by a test-runner:

Makefile.x86_64-linux.tmp/run/OUTPUT
Makefile.x86_64-linux.tmp/run/script.py

Any file in a path containing the pattern Makefile.* somewhere as a parent directory name, is considered by Kate as Other/Makefile. This can be seen by the checked option in Tools > Mode after opening a file.

Expectation: In the above example I would expect Mode=Normal for OUTPUT and Mode=Script/Python for script.py, but both have Mode=Other/Makefile.

I tried to change the behaviour by configuring the file extensions for the file types in Settings > Configure - Kate > Open/Save > Modes&Filetypes. But I could not figure out how I have to change the File extensions field for Other/Makefile to only check the filename and not the full path.

My question is: Is it even possible to change the following default entry for File extensions to only search the basename and not the dirname? If it is, how can it be done?

GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*

The .appears to be treated literally and * appears to expand greedy. I tried adding something like Makefile[^/]*, but then normal Makefiles with suffixes are not recognized anymore (e.g. Makefile.default)

My current workaround is to make the last patterns more specific like Makefile.def* to not match the ./Makefile.x86_64-linux.tmp/run/some_file. But I have to add any patterns I encounter in my colleagues code bases manually.

Any help is appreciated! Thanks!

0 Answers0