Version: CVS (using KDE Devel)
Installed from: Compiled sources
I am working on serveral Open Source projects and they are all using different indentations. It would be nice to all setting indent size and 'tabs or space' as a project option. Right now I have to adjust this manually when I switch projects.
An added bonus would be to have a hot key for running 'indent' with per project rules. These rules would take into account the project indentation setting and language.
I disagree. I think that this setting should be global as the default behavior, with a per project setting to override global option if one exists.
*** Bug 69470 has been marked as a duplicate of this bug. ***
Also, there should not be separate controls for indentation in the source formatter and editor. This should be a single setting per project, with a global default.
I'd also very much appreciate to be able to set indentation style on a per-project basis. I'm working on different (Python & PHP) projects at the same time, and I have to change "Use spaces instead of tabs to indent" everytime I switch between those project. Since I'm lazy, I'd like to have that done automatically. :-)
SVN commit 610150 by webb:
Include the project level formating options.
Corrected bug with formatting options being lost.
M +1 -1 Makefile.am
M +25 -32 astyle_adaptor.cpp
M +6 -2 astyle_adaptor.h
M +127 -17 astyle_part.cpp
M +23 -2 astyle_part.h
M +123 -89 astyle_widget.cpp
M +2 -2 astyle_widget.h
M +21 -0 astyleconfig.ui
I'm not sure how to make use in 3.4.0 of the feature introduced by your commit . I have chosen, in Project->Project Options, Formatting, 'User defined' and chosen to use spaces instead of tabs for a project that uses that formatting (kaddressbook), but the behaviour of both the tab key and the automatic indentation on newline comes from the Settings->Configure Editor...->Indentation settings config.
Can you explain how to use it? As I'm always bugfixing different KDE apps at work it would be very helpful to not have to change expandtabs by hand all of the time.
Ok, Andreas Pakulat explained to me on IRC that "the formatting options can obly be applied by using Reformat Source in the Edit menu; that will either reformat the whole current file according to the options set, or the selection that is active. Indentation/formatting while typing is solely done by kate and its indenter sucks a bit."
Adymo solved it for me by pointing me at http://kate-editor.org/article/.kateconfig and saying that setting the 'search depth for config file' in Configure Editor...->Open/Save to some value large enough that Kate will find a .kateconfig file in the root of the svn module, for any source file in the module - kate starts its search in the directory where the file being opened is located.
My .kateconfigs contain either
kate: space-indent on; tab-width 2; indent-width 2; replace-tabs on; eol unix;
kate: space-indent off; tab-indent on; tab-width 4; indent-width 4; replace-tabs off; eol unix;