Bug 160034

Summary: indentation should be based on filetype by default
Product: [Applications] kate Reporter: Robin Pedersen <robinpeder>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Robin Pedersen 2008-03-28 19:54:10 UTC
Version:            (using Devel)
Installed from:    Compiled sources

When opening a file, kate automatically detects the filetype, and selects the correct mode for syntax highlighting.

The same method should be used BY DEFAULT to set correct indentation mode.

User story:
"My mother uses a fresh installation of KDE on her computer. Without doing any customization, she starts kate and opens a file written in Java. Kate automatically sets indentation mode to Java."

"Java" could of course be any file format supported by kate (indentation scripts for more filetypes are needed of course). The correct indentation for each file type should be configured by default.

In addition, the configuration dialog for indentation must be improved:
Currently the "Default indentation mode" can be set in Configuration -> Editing -> Indentation. But I don't think anyone has a "default indentation mode" for all file types. This should be removed, and replaced by a similar selection on the "filetype properties" page, currently under Open/Save.

The current workaround is to type "kate: indent-mode <mode>" into Variables under filetype properties. This is way too much work. There should be at least a ComboBox for indentation on that page, but preferably ALL default indentation settings, like indent width, spaces vs. tabs etc. should be based on filetype, and available in this dialog. For convenience, some actions to "apply this change to all filetypes" should be available.
Comment 1 Anders Lund 2008-03-28 20:22:50 UTC
This is just a question about adding that to the default configuration file.

We never did that though, for some reason. It is one of the first things I do 
when running kate without configuration, setting indentation mode for C style 
languages...

Maybe the reason it is not set is that when set, it automatically turns auto 
indentation on for the mime type(s), that could be considered a flaw, since 
it would be easier for the user to just turn auto indenation on/off and not 
having to fight selecting the correct mode.
Comment 2 Robin Pedersen 2008-03-28 21:47:43 UTC
> This is just a question about adding that to the default configuration file.

That's exactly what was wished for. This is supported by other popular editors, e.g. TextMate, that automatically enables auto indent for a lot of filetypes.
Comment 3 Dominik Haumann 2010-11-22 23:49:59 UTC
Robin, didn't you fix this yourself?
Comment 4 Robin Pedersen 2010-11-24 08:05:10 UTC
Someone fixed it. I can't remember if it was me or someone else.