In IDEA, we can comment/uncomment lines in java as well as html,jsp, xml files with the same keyboard shortcut combination. I tried doing that in eclipse but was not able to comment out lines in html,jsp and xml files. Is there a way to do it in Eclipse? Also I would like to know whether bulk comment is also available for non-java files.
I use the (Ctrl+Shift+,) shortcut to comment out selected XML all of the time.
PDT allows you to quickly and easily comment and uncomment code by selecting a line or a block of text and tagging it as a comment. Comments can be added to single lines of code (Ctrl + /) or blocks of code (Ctrl + Shift + /).
For single line comment you can use Ctrl + / and for multiple line comment you can use Ctrl + Shift + / after selecting the lines you want to comment in java editor.
I use Shift+Ctrl+/ to Add Block Comment in both XML and JSP files (works at the line level or for a selected block).
Just in case, if you are looking for a particular shortcut, you can use Shift+Ctrl+L to Show Key Assist (i.e. the Commands and their Bindings).
I believe CTRL+SHIFT+C works in XML, not sure about JSP. I think it lacks consistency in the various editors, and some don't have this shortcut.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With