如何在 Eclipse 中折叠代码块?

发布于 2024-09-13 21:35:51 字数 130 浏览 2 评论 0原文

几天前,我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

思念满溢 2024-09-20 21:35:51

首选项-> 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...

无边思念无边月 2024-09-20 21:35:51

您可以执行( 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.

青芜 2024-09-20 21:35:51

尝试此选项:首选项 >爪哇>编辑>折叠>启用折叠

Try this option: Preferences > Java > Editor > Folding > Enable folding

ぺ禁宫浮华殁 2024-09-20 21:35:51

折叠所有代码块
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

生来就爱笑 2024-09-20 21:35:51

对于 Python,如下所示:

  • 折叠所有 1 级:Ctrl+9
  • 展开所有 1 级:Ctrl+0
  • 折叠当前:Ctrl+-
  • 展开当前:Ctrl++

希望有所帮助。

For Python it is as follows:

  • collapse all 1 level: Ctrl+9
  • expand all 1 level: Ctrl+0
  • collapse current: Ctrl+-
  • expand current: Ctrl++

Hope that helps.

青春有你 2024-09-20 21:35:51

在首选项中,您会发现常规>钥匙。它用于设置键盘快捷键。

不过,我更经常使用它的是在 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.

扭转时空 2024-09-20 21:35:51

我假设您使用的是 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".

秋意浓 2024-09-20 21:35:51

如果您想折叠所有编辑器,我发现您可以在

“首选项”>“折叠”中启用“折叠”。编辑>结构化文本编辑器

启用折叠

If you want folding an all your editors, I found you can enable Folding in

Preferences > Editors > Structured Text Editors

Enable Folding

七度光 2024-09-20 21:35:51

对于使用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.

花开浅夏 2024-09-20 21:35:51

干得好!

  1. 右键单击最左侧编号条上出现的 + 按钮 -->折叠-->全部展开
  2. 右键单击​​最左侧编号条上出现的 + 按钮 -->折叠-->全部折叠

通过这种方式,您可以展开和折叠文件中的所有方法。

编号条上的加号按钮

上下文菜单:

上下文菜单

Here you go!

  1. Right Click on + button appeared on numbering strip on left most side --> Folding --> Expand All
  2. Right Click on + button appeared on numbering strip on left most side --> Folding --> Collapse All

This way you can expand and collapse all the methods on the file.

Plus Buttons on numbering strip

Context Menu:

Context Menu

山川志 2024-09-20 21:35:51

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

公布 2024-09-20 21:35:51

我将 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文