| Summary: | Need to be able to specify indentation settings by project | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Aaron Williams <aaronw> |
| Component: | All editors | Assignee: | kdevelop-bugs-null |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | igorkuo |
| Priority: | NOR | Keywords: | usability |
| Version First Reported In: | 5.6.2 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Aaron Williams
2021-10-30 05:49:49 UTC
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. |