Search code examples
javaintellij-ideacommentskeyboard-shortcuts

IntelliJ shortcut ctr + / adds a comment at the first column instead of current


When I want to comment or comment my code out with the shortcut ctrl + /, IntelliJ puts the // at the first column instead of the current. How can I make comments at the current?

Example

        System.out.println(set.containsAll(subSet));
//        System.out.println(set.containsAll(subSet));

Using ctrl + /, I would like to make it like that

        //System.out.println(set.containsAll(subSet));

Solution

    • Settings | Editor | Code Style | Java | Code Generation | Comment Code | Line comment at first column -> Uncheck
    • Settings | Editor | Code Style | Java | Code Generation | Comment Code | Block comment at first column -> Uncheck
    • Settings | Editor | Code Style | Java | Wrapping and Braces | Keep when reformatting | Comment at first column -> Uncheck