Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse shortcut for commenting jsp, xml code

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.

like image 810
Thunderhashy Avatar asked Feb 06 '10 00:02

Thunderhashy


People also ask

What is the shortcut key for comment in XML?

I use the (Ctrl+Shift+,) shortcut to comment out selected XML all of the time.

How do I comment multiple lines in XML in Eclipse?

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 + /).

How do you comment code in Eclipse?

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.


2 Answers

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).

like image 142
Pascal Thivent Avatar answered Sep 18 '22 04:09

Pascal Thivent


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.

like image 33
harschware Avatar answered Sep 17 '22 04:09

harschware