How to stop unnecessary indent on a new line?
How do I get Datagrip to stop adding an unnecessary indent on a new line?
For example, I want this….
line 1: -- This is a comment without an unnecessary leading indentline 2: -- This is comment on a new line WITH an necessary leading ident added by Datagripline 3: -- After hitting RETURNline 4: -- As you can see these unnecessary indents are really annoying andline 5: -- contribute nothing of valueline 6: -- How do I stop this nonsense so I don't waste my time removingline 7: -- all of these unnecessary indents in my code?
to be this…
line 1: -- This is a comment without an unnecessary leading indentline 2: -- This is comment on a new line WITH an necessary leading ident added by Datagripline 3: -- After hitting RETURNline 4: -- As you can see these unnecessary indents are really annoying andline 5: -- contribute nothing of valueline 6: -- How do I stop this nonsense so I don't waste my time removingline 7: -- all of these unnecessary indents in my code?
without me constantly going back and removing all of the indents
Please sign in to leave a comment.
Chris1058wright thank you. All of those options are already turned off. Yet I still get automatic indentation.
Aleksandr Molchanov The number of indent,wrap,chop options in the code style section is huge. Asking me to manually list them all seems unreasonable. I have attached my current code style XML.
FWIW, the problem still occurs when I set my current code style to the default settings for Oracle.
Hi kdwhite,
Had the same irritating issue and spent way too much time before I found this post. Hitting Enter after a comment (-- or /* */) indented the next line. Can confirm that Aleksandr's earlier advice regarding Smart Keys pointed me in the right direction and worked. Many thanks Aleksandr Molchanov.
I disabled Smart Indent under the Enter section in File | Settings | Editor | General | Smart Keys and now the cursor is placed at the correct indentation level (DataGrip 2026.2.6, dialect: SQLite).
Mike Neumann, glad I pointed you in the right direction.