在 Mac 上的 Eclipse 中注释块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/741264/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Commenting blocks in Eclipse on Mac
提问by burntsugar
How do I comment blocks of code in Eclipse on a Mac?
如何在 Mac 上的 Eclipse 中注释代码块?
回答by Darryl E. Clarke
Apple + Shift + / will toggle a block of selected code using /* */
Apple + / will toggle a line (or multiple, if selected) using //
Apple + Shift + / 将使用 /* */ 切换所选代码块
Apple + / 将使用 // 切换一行(或多个,如果选择)
You may have to disable the OS hotkey (apple + shift + / brings up the help menu)
您可能需要禁用操作系统热键(apple + shift + / 调出帮助菜单)
回答by PawelPros
Ctrl + cmd + / <- block comment and Ctrol + cmd + \ <- remove comment
Ctrl + cmd + / <- 阻止注释和 Ctrol + cmd + \ <- 删除注释
回答by Tom
Command (the clover/apple key next to the space bar) forward slash (/)
命令(空格键旁边的三叶草/苹果键)正斜杠 (/)
回答by Aaron Maenpaa
Command
+ /
comments the selection.
Command
+/
评论选择。
回答by Tadele Ayelegn
select the text that you want to put as a comment and use
'command
+ /
' to apply multi line comment with each line having '//
'
选择要作为注释的文本,然后使用“ command
+ /
”应用多行注释,每行带有“ //
”
However If you use
'command
+ control
+ /
' will have the text commented with '/* ... */
' at the beginning and end which is much better than the previous one
但是如果你用“ command
+ control
+ /
”将标记有“文/* ... */
在开头”和结束这远好于前一个
回答by Xanlantos
Short Answer:
简答:
select the text that you want to put as a comment and use
选择要作为评论的文本并使用
?+ ?+ C
?+ ?+C
Long Answer:
长答案:
Single line
单线
Toggle of same keys
切换相同的键
comment?+ ?+ C
评论?+ ?+C
uncomment?+ ?+ C
取消注释?+ ?+C
Multiline
多线
comment?+ /
评论?+/
uncomment?+ \(note the backslash)
取消注释?+ \(注意反斜杠)
For an Exact List of all Shortcuts or if you want to change some look at:
有关所有快捷方式的确切列表,或者如果您想更改一些外观:
Eclipce->Settings->General->Keys
Eclipce->设置->通用->按键