如何在 Eclipse 中折叠代码块?
几天前,我的 Eclipse 工作正常,每个可以折叠的块(函数、类等)中都出现了 +/- ......但现在它确实出现了,我不知道如何再次激活该功能。
它是 Eclipse Helios,运行在 Gentoo Linux 机器上。
Some days ago my Eclipse was working fine and a +/- appeared in every block that could be collapsed (functions, classes, etc.)... but now it does appear, and I don't know how to activate that feature again.
It's Eclipse Helios, running on a Gentoo Linux box.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
首选项-> C++->编辑->折叠式的 ?
在编辑器窗口中右键单击并转到那里的首选项,然后只会显示首选项对话框中与编辑器相关的部分。这适用于 JDT、CDT 等...
Preferences -> C++ -> Editor -> Folding ?
Make a right click in the editor window and go to preferences there, then only the editor-relevant section of the preferences dialog will appear. This works for JDT, CDT etc...
您可以执行( Ctrl + Numpad_Divide )来启用折叠。
此外,如果您在
+
或-
应该所在的区域上右键单击
,您可以看到有一个折叠选项。You can do ( Ctrl + Numpad_Divide ) to enable folding.
Also if you
Right Click
on the area where the+
or-
was supposed to be, you can see there is a folding option.尝试此选项:首选项 >爪哇>编辑>折叠>启用折叠
Try this option: Preferences > Java > Editor > Folding > Enable folding
折叠所有代码块
Ctrl + Shift+ /
展开所有代码块
Ctrl + Shift+ *
pydev:
折叠所有代码块:
Ctrl + 0
折叠所有代码块:
Ctrl + 9
有没有办法折叠 Eclipse 中的所有代码块?
作者:@partizanos 和 @bummi
To collapse all code blocks
Ctrl + Shift+ /
To expand all code blocks
Ctrl + Shift+ *
pydev:
To collapse all code blocks :
Ctrl + 0
To collapse all code blocks :
Ctrl + 9
Is there a way to collapse all code blocks in Eclipse?
by @partizanos and @bummi
对于 Python,如下所示:
希望有所帮助。
For Python it is as follows:
Hope that helps.
在首选项中,您会发现常规>钥匙。它用于设置键盘快捷键。
不过,我更经常使用它的是在 Eclipse 中查找内容。您应该会看到一个标有“键入过滤器文本”的输入框。它就像 Eclipse 为每个 Eclipse 命令提供搜索功能一样。
In Preferences, you'll find General > Keys. It's for setting your keyboard shortcuts.
What I use it for more often, though, is to find stuff in Eclipse. You should see an input box labelled "type filter text." It's as close as Eclipse comes to a search feature for every Eclipse command.
我假设您使用的是 Java,但请查看您的特定语言的设置。
在“窗口”菜单下,选择“首选项”。
在Java->编辑器->折叠下。选择“启用折叠”。
I assume you are using Java, but look under the settings for your particular language.
Under the Window menu, select Preferences.
Under Java->Editor->Folding. Select "Enable Folding".
如果您想折叠所有编辑器,我发现您可以在
“首选项”>“折叠”中启用“折叠”。编辑>结构化文本编辑器
启用折叠
If you want folding an all your editors, I found you can enable Folding in
Preferences > Editors > Structured Text Editors
Enable Folding
对于使用java的windows eclipse:Windows ->首选项-> Java->编辑-> 不幸的是,
这不允许折叠代码,但是如果它关闭,您可以重新启用它以摆脱长注释和导入。
For windows eclipse using java: Windows -> Preferences -> Java -> Editor -> Folding
Unfortunately this will not allow for collapsing code, however if it turns off you can re-enable it to get rid of long comments and imports.
干得好!
通过这种方式,您可以展开和折叠文件中的所有方法。
编号条上的加号按钮
上下文菜单:
上下文菜单
Here you go!
This way you can expand and collapse all the methods on the file.
Plus Buttons on numbering strip
Context Menu:
Context Menu
在 CFEclipse 中:
首选项> CF日食>编辑>代码折叠>最初折叠列,您可以取消选中以在打开时查看所有展开的内容,或选中所有框以在打开文件时关闭所有内容。
In CFEclipse:
Preferences > CFEclipse > Editor > Code Folding > Initially Collapse column, you can uncheck to see all expanded when opening, or check all boxes to close all when opening a file.
我将 salesforce apex 类与 Eclipse Neon 3.3 for Java 一起使用。
我在编辑器中右键单击时发现了一个选项“定义折叠区域”,我选择了要折叠的代码块,然后为该代码选择了此属性。现在我看到 + 和 - 符号来展开和折叠该代码块
I was using salesforce apex classes with Eclipse Neon 3.3 for Java.
I found an option "define folding region" on right click in the editor, I selected the block of code i wanted to collapse and selected this property for that code. Now I am seeing + and - symbol to expand and collapse that block of code