![]() Registered Member ![]()
|
I am a little confused about the right indentation in python.
In kwrite, and in python scheme, when i press ENTER after a ':' it does an indentation. This is different with the indentation when i press on tab , and different with the indentation in vi editor. What do you use as editor with python to have an homogenized indentation ? |
![]() Global Moderator ![]()
|
For python, you should always use 4 space indentation. If you put this in the kate settings, it works very well. What's your problem more exactly?
Greetings
I'm working on the KDevelop IDE.
|
![]() Registered Member ![]()
|
The vi editor makes a tab of 10 columns when i press enter after the ":"
The kate editor make a tab of 4 columns The tab with kate it is not a real tab. If i click on "del" at the beginning of the line it will not delete the space of the tab (4 columns) but one column at the time. Instead the tab that i did in the vi editor, when i open the file in kate, i see a real tab. There is the » at the beginning of the line and if i press on "del" i can delete the whole tab (10 columns) and not only one column. ![]() |
![]() Administrator ![]()
|
Open Kate > Settings > Configure Kate > Editor Component > Editing. Select the "Indentation" tab. You probably have "Tabulators and Spaces" selected - and the "Tab width" and "Indentation width" will be set to different values - likely 10 and 4 respectively.
To fix this, simply set both to 4 characters.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Global Moderator ![]()
|
Yes. I also recommend setting indentation to "Spaces" instead of "Spaces and tabs", and reconfiguring vi so it indents with 4 spaces. This is an official python coding guideline (see "PEP 8").
To make kate unindent in the beginning of a line if you press backspace, activate the corresponding checkbox in Editing -> Indentation. Greetings, Sven
I'm working on the KDevelop IDE.
|
![]() Registered Member ![]()
|
Ok i did all the changes you suggested
Thanks very much both of you |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient