How to disable ALL auto identation and code formatting.

Answered

How to disable all this features? I disabled most of then, but CLion still sometimes inserts tabs when i dont press TAB key and delete tabs from lines that i paste using Ctrl-V.

2
6 comments

Hi! Code style settings can be configured in File | Settings | Editor | Code Style | C/C++. Indents can be configured in the Tabs and Indents tab. Also you can disable Smart indent in File | Settings | Editor | General | Smart Keys. More info about reformatting source code - https://www.jetbrains.com/help/clion/reformatting-source-code.html.

1
Avatar
Permanently deleted user

I have already done this.

1

Could you please specify what exactly you have done already?

In  File | Settings | Editor | General | Smart Keys you need to disable Smart indent (this should help for cases when "CLion still sometimes inserts tabs when i dont press TAB key") and set Reformat on paste to None (this should help for cases when "CLion deletes tabs from lines that i paste"):

To apply the changes you need to click on "Apply" button.

Have you set both options like this? Does it help?

If you still experience inconvenient auto-indent even with Smart indent disabled and Reformat on paste set to None, please describe in detail cases when that happens and provide us with some examples.

-1
Avatar
Permanently deleted user

When i write something like:
int\t\tfoo(void)\n
{\n
\tint\t\ti;\n
\n
\ti = 0;\n
....
I receive:
int\t\tfoo(void)\n
{\n
\tint\t\ti;\n
\t\n
\t\ti = 0;\n
...

0

I'm afraid such kind of indentation can't be disabled at the moment. This is the description of the Smart Indent option from our web-help: "If the checkbox is cleared, upon pressing ⏎ in a blank line, CLion adds a new line and positions the caret at the current non-space character column". In other words, lines are aligned relatively to each other. Actually, CLion just helps you to do less actions, namely - to avoid pressing Tab on the i = 0; line.

I've created the feature request based on your post - https://youtrack.jetbrains.com/issue/CPP-12815. Feel free to comment or upvote, follow it to get updates.

0

Sorry to rant but I've never seen a “feature” in an IDE that I've hated more than the way Intellij insists on reformatting my code. It seems like Intellij wants to train its users rather than letting them have some freedom to work in the style that works best for them. This makes makes me yearn for the days I used to code in a text editor.

Why, why, why can't I just turn this formatting “feature” off?

0

Please sign in to leave a comment.