How to change default code indentation/alignment in files?

for C# files I have something like this (no space between line numbers and code)

In another file I have the following (annoying) space in between the line numbers and the code. How can I remove this?

0
5 comments

What kind of file is it? Generally, code style settings for a language is in `File | Settings | Editor | Code Style`. You can apply formatting rules as described here: https://www.jetbrains.com/help/rider/Enforcing_Code_Formatting_Rules.html

0

This is a  .cmd file, the same happens with .ps1 and .sh files and they don't show up in `File | Settings | Editor | Code Style`.

Also just to disperse any confusion about the 'indentation' it's not the kind of indentation that I can remove, it's like the 'gutter' or whatever it's called (this ui component is part of the line numbers, where if I right click on it there are different context options compared to the code).


0

Are you using Distraction free mode? At the moment, it behaves differently on C# and .cmd and other types of files. 

Workaround

  1. Go to Settings | Editor | Code Style
  2. Increase "Hard wrap at ... columns" value to lower the margin (see this comment for details)

See https://youtrack.jetbrains.com/issue/IDEA-145837

Hope this helps!

0

That fixed it thank you :)

I thought Hard Wrap would mean if text is overflowing it would try to put it on the next line.

0

Yep, that's true. Hard wrap is for putting code on the next line. However, this is also a workaround to lower the margin in distraction free mode :)

0

Please sign in to leave a comment.