I thought this would be easy to achieve, but so far I haven\'t found solutions for comment/uncomment shortcut on both Java class editor
and jsf faceted we
For a Mac it is the following combination: Cmd + /
Ctrl + Shift + C . Works great on .java, .xhtml, .properties and maybe on others but I only tested these ones. Can comment single or multiple lines.
Ctrl + 7 to comment a selected text.
For those who like to customize things (and screw them up), some tips:
In "Preferences" - "General" - "Keys", type "comment" to get a full list of comment key combination in all editors. Be sure only to edit, not copy commands(because you cannot erase created ones).
For HTML files, look for those with scope "Editing HTML files". The names are confusing, yes, but the description shows more or less when each and every key is used.
At last, I am only able to define block comment in HTML here. It works for both HTML code and Javascript code(add at the beginning and the end, <!--
and -->
if is HTML, and add /*
and */
if is Javascript). (I remember once there may be a "line comment" key (add comments for every line) but now it is not there anymore. If someone knows how to find it and tell me, I will be very grateful.)
The category must be Edit
. Source
does not work.
EDIT:
I found how to configure XML Toggle comment! The category should be Edit
, too. Then you can toggle comment in **XML Editor(the one with "Design" and "Source" tabs).
In eclipse Pressing Ctrl + Shift + L, will list all the shortcuts.