Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure removing space between line comment slasles and text in Intellij IDEA?

If I want to comment line I use "Ctrl+/" and get the "//" at start of line

enter image description here

Then I use auto formatting with "Ctrl+alt+L" keys and get

enter image description here

At the end I must remove space between "//" and text manually every time...

enter code here

Can I do all of these steps in one time? I didn't find any settings for this...

like image 779
lordmegamax Avatar asked Dec 04 '13 11:12

lordmegamax


People also ask

How to comment multiline in IntelliJ?

In this case, using a multi-line comment is our only option no matter how short our comment needs to be. Block comments are enclosed in slash-asterisk ( /*) and asterisk-slash ( */ ). To add a block comment in IntelliJ IDEA, press ⌥ ⌘ / macOS or Ctrl + Shift + / on Windows and Linux.

How can I beautify code in IntelliJ?

Go to Settings/Preferences | Editor | Code Style, select your programming language, and open the Wrapping and Braces tab. In the Keep when reformatting section, select the formatting rules which you want to ignore and deselect those which should be applied. Reformat your code ( Ctrl+Alt+L ).

Why is there a line in IntelliJ?

Basically, it's the guide line showing where the wrapping will occur (if enabled for certain code constructions).


1 Answers

An alternative, not perfect though, is:

  1. Editor -> Code Style -> Java -> Code Generation
  2. Uncheck Line Comment at first column

The menu hierarchy is the one in Intellij IDEA 14.

like image 186
Dario Zamuner Avatar answered Nov 15 '22 12:11

Dario Zamuner