For bash or python files, that do not end in ".py" or ".sh", kdevelop doesn't know what they are, even if they begin with a thing like: #!/usr/bin/env python3 So, they should be autodetected instead. Also, if I manually set something, it should be stored in the project file and remembered for the next time, instead of me needing to do it every single time I edit the file.
Can you not set a proper mime type for the files in your system's mime database?
$ file /tmp/pythonscript /tmp/pythonscript: Python script, ASCII text executable $ file --mime /tmp/pythonscript /tmp/pythonscript: text/x-python; charset=us-ascii What is there to set?
I did some brief testing on my Arch system with KDev* master, using a file named `no_suffix` having the contents ``` #!/usr/bin/env python3 print("Hello, world!") ``` Mime tools detect it: $ file --mime no_suffix no_suffix: text/x-python; charset=us-ascii $ kmimetypefinder5 no_suffix text/x-python3 KWrite *doesn't* detect it - the default ksyntaxhighlighting and indentation are 'None' and 'Normal' respectively. Both of these work fine if explicitly enabled. Using KDevelop, it *does* get assigned to and recognised by kdev-python - there are tooltips, semantic highlighting etc. - but the ktexteditor highlighting/indenter still aren't used by default. KDevelop uses either the default text-file icon or a '[?]' icon in the Projects/Filesystem toolviews, open-files menu etc., not the Python icon.
Changing the shebang to `... python or `... python2` fixes the ksyntaxhighlighting detection in KWrite (but not KDevelop). With `...python3`, the detected mimetype is 'text/x-python3'; ksyntaxhighlighting doesn't understand `<sub-class-of type='text/x-python'/>` in the mime database and it's not listed explicitly in python.xml I don't yet understand why KDevelop behaves differently.
This has been fixed at some point. KDevelop and other KTextEditor-based applications now detect such files.