How to stop autoformatting ?

Answered

I have used IntelliJ ultimate version in Vim mode for just about 1 day, and I'm thinking about using it for my work as a Java developer (as I have heard so much good about it). But it annoys me a lot that it is making auto formatting or automatic changes the view style of the code (at least it do sometimes). I have tried to enable auto formatting in Settings -> Editor -> Code style, and added a // @formatter:off in the source code (but since I'm working with other people who might not use IntelliJ I would very much prefer not need comments in the source code):

 But when I want my code to always be shown like this:

public static void main(String[] args) {
    System.out.println("Hello, World!");
}

IntelliJ (sometimes) changes it to (even when I try to manually add a new line):

public static void main(String[] args) { System.out.println("Hello, World!"); } // (on a single line)

Which I found to be extremely annoying as I just want ALL source code to be EXACTLY as a wrote it all the time! Both Netbeans, JDeveloper, and Eclipse just leave the code as it was written, and I hope that IntelliJ can do the same also without having to add comments in the source code!

0
2 comments

It's called Code Folding, you can disable it here:

0
Avatar
Permanently deleted user

Thanks. Now It's working as wanted :-)

 

0

Please sign in to leave a comment.