Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to modify Eclipse's comment behavior to add the slashes at the current level of indentation, rather than at the beginning of the row?

By default, pressing the Comment out shortcut keys Ctrl + /, has behavior like this:

enter image description here

Notice that the // get added at the left-most position of the row.

Is there a way to set it so that the // appear at the same level of indention as the code that is being commented out?

e.g.
enter image description here

Perhaps a Python habit, but I find it much easier to parse when everything is at the same indention level.

Is there a way to change where the slashes show up?

like image 647
Zack Yoshyaro Avatar asked Mar 31 '13 22:03

Zack Yoshyaro


1 Answers

Yes, it's possible. go to this link for detailed info

First go to Preferences, then

On the left side of the box, expand the Java option, then expand Code Style and finally click Formatter

You'll land on the Java-Profile page: enter image description here

The other, temporary way is via CTRL+SHIFT+F shortcut ( Eclipse: Change the block comment style of ctrl+shift+/ ) . So you'd highlight those comments, and press the combo.

I would then also use a shortcut for CTRL+SHIFT+F , like ALT+F5 (press CTRL+3 , 'keys' to get the preferences page.

like image 84
Caffeinated Avatar answered Nov 13 '22 08:11

Caffeinated