Right now the only way to configure indentation is in the global settings. This should be on a per-project basis. For example, I deal with multiple projects, often open at the same time in different KDevelop sessions. Some projects use the Linux kernel indentation with 8 space tabs whereas others use 4 spaces and don't use tabs. Adding Kate mode lines is also not acceptable in many cases. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
You can configure source formatter in project settings. Enable the Override editor indentation mode option there. But if you select Custom Script Formatter, this might not work right away. If so, check if merging https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/273 makes it work.
I am using custom indentation settings for several of my projects. There are also variations on using tabs vs spaces which seems to only be set in the global editor indentation settings.
1. Right click on a project in Projects tool view. 2. Switch to the Source Formatter tab. 3. Uncheck the Use default checkbox. 4. Check the Override editor indentation mode checkbox. 5. Select a formatter and a style for each language you use (e.g. C, C++, note that *.h files are always treated as C). If none of the predefined styles suites your needs, create your own. Tabs vs spaces and their widths can be configured in KDevelop's Artistic Style visual editor and in configuration files or command line options to custom scripts (e.g. GNU Indent, Clang Format, uncrustify). You can also configure source formatters on per-session rather than per-project basis in main menu => Settings => Configure KDevelop... => Source Formatter.
Sorry, missed one step: > 1. Right click on a project in Projects tool view. 1.5. Click Open Configuration... > 2. Switch to the Source Formatter tab.