Eclipse 注释/取消注释快捷方式? [英] Eclipse comment/uncomment shortcut?
问题描述
我认为这很容易实现,但到目前为止我还没有在 Java 类编辑器
和 jsf faceted webapp XHTML 文件编辑器上找到注释/取消注释快捷方式的解决方案代码>:
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 webapp XHTML file editor
:
- 快速注释/取消注释一行(如 ctrl + d 用于删除单行)
- 能够选择多行并注释/取消注释
- to quickly comment/uncomment a line (like ctrl + d is for removing single line)
- being able to choose multiple lines and comment/uncomment it
<小时>
例如:
单行java代码,来自:
private String name;
进入
//private String name;
<小时>
多行java代码,来自:
private String name;
private int age;
进入
/*private String name;
private int age;*/
<小时>
单行 xhtml 代码,来自:
<h:inputText ... />
进入
<!-- h:inputText ... / -->
<小时>
多行 xhtml 代码,来自:
<h:inputTextarea
rows="xx"
cols="yy"
...
/>
进入
<!-- h:inputTextarea
rows="xx"
cols="yy"
...
/ -->
<小时>
推荐答案
单行注释可以使用 Ctrl + / 多行注释可以使用 Ctrl + Shift + / 在 Java 编辑器中选择要注释的行后.
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.
在 Mac/OS X 上,您可以使用 ⌘ + / 注释掉单行或选定的块.
On Mac/OS X you can use ⌘ + / to comment out single lines or selected blocks.
这篇关于Eclipse 注释/取消注释快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!