This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to change automatic spacing settings?

Tags: None
(comma "," separated)
chartrekhan
Registered Member
Posts
2
Karma
0
Hi
I started using KDevelop for C/C++, but it does some weird autocompletion things that I can't find in the settings menus or documentation.
1. When I type // for an inline comment, it puts a bunch of spaces before the comment, presumably to make the comments line up, but I don't want to do this / want to do it manually where possible. It's really annoying actually because even if I delete the spacing, as soon as I type a comment containing spaces, the spacing comes back, sometimes wrapping onto a new line, so I have basically no way to type or edit an inline comment.
2. When I type //, it adds a space after the comment marker.
3. When I type << at the start of a line (continuing the previous line) it deletes all the indentation before the << for some reason. It does this for a couple other markers.
4. When I start a new line, sometimes the editor will put a space or two after the indentation for no apparent reason, and I have to backspace it. For example, it puts one space if I start a new line after typing a {.
I can't find these settings in autocomplete settings, indentation settings, or source formatting settings. How do I disable these features? I'm sure they must be useful for some, but they are getting in my way.
chartrekhan
Registered Member
Posts
2
Karma
0
Ok, I figured out that it's due to the "indentation mode" being C++/boost style. But I still want to know if there's any way to customize the indentation behaviour beyond just changing the mode, or are the modes fixed?
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS
KDevelop use KatePart as editor component. I don't know in which file the indetation is defined, but you may try to change the indentation behavior with document variables. Go into settings for editor, select Open/Save and then select tab Modes & Filetypes. Here you can select the indentation you like or/and add document variables.
jeremya
Registered Member
Posts
2
Karma
0
I came to this forum because I cannot change the indent from 4 spaces - I want 2 spaces.
I have used the following paths to no effect

Settings -> Configure KDevelop -> Language C, Source Formatter Artistic, ANSI
Settings -> Configure KDevelop -> Editing , Indentation Normal, spaces 2

I have also tried
Settings -> Configure KDevelop -> Editing, Open/Save Sources/C++, Indentation normal
(I notice on that form it has variables kate:)

What else can I do to get a two space tab/indent in the ANSI style?

Edit I am using 5.5.2 in an appimage
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Go to "Settings -> Configure KDevelop -> Editing -> Indentation", set "Indent using: Spaces, Indent Width: 2". That certainly works. Try it in a new file.

If not, please post an example source code file -- maybe it has a kate modeline saying something else already?


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]