Eclipse - Save Folding on Quit

前端 未结 4 1284
隐瞒了意图╮
隐瞒了意图╮ 2020-12-16 14:48

Is there any way to save my code folding in eclipse?

It\'s horrible to scroll trough my entire UI declaration. (And yes, I googled it! :)

相关标签:
4条回答
  • 2020-12-16 15:31

    This, and plenty other issues of Eclipse made me switch to JetBrains IntelliJ IDEA. It's worth sneaking a peek at it if you find Eclipse's performance annoying, need more control on your code formatting or if you just want to have your code foldings persisted.

    I'm not using it for too long now but it seems pretty handy for anyone developing in the Java, Android or Scala corner.

    0 讨论(0)
  • 2020-12-16 15:32

    Amongst other things, Mylyn allows you to fold/hide content and persist the state.

    Mylyn monitors your work activity to identify relevant information, and uses this task context to focus the user interface on the task-at-hand. This puts the information you need at your fingertips and improves productivity by reducing searching, scrolling, and navigation. By making task context explicit Mylyn also facilitates multitasking, planning, reusing past efforts, and sharing expertise.

    Once Mylyn is enabled it will start folding/hiding the content. If you have an active task (can use a local task repository) the state should be persisted between sessions. Alternatively you can attach the state to the task (sorry don't have Eclipse to hand to check the exact method to do this) then retrieve it. This is useful if you are sharing tasks with others.

    0 讨论(0)
  • 2020-12-16 15:38

    The question is very similar to Is there a way to collapse all code blocks in Eclipse? .

    I'm re-posting my answer there here.


    The question is a bit old, but let me add a different approach. In addition to the above hot-key and utility approaches, there are default preference settings that can be toggled.

    As of Eclipse Galileo (and definitely in my Eclipse Version: Indigo Service Release 2 Build id: 20120216-1857) language specific preferences can open up new files to edit which are already collapsed or expanded.

    Here is a link to Eclipse Galileo online docs showing the feature for C/C++: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_folding.htm .

    In my Eclipse Indigo I can open the Folding Preferences window via : menu/ Window/ Preferences/ Java/ Editor/ Folding and set all options on so I can open files by default that are completely collapsed.

    0 讨论(0)
  • 2020-12-16 15:39

    I know this isn't exactly what you were asking, but this was really helpful for me:

    • Ctrl+Numpad_Multiply can also be used to expand all
    • Ctrl+Shift+Numpad_Divide is bound to collapse all
    • Ctrl+Numpad_Divide toggles folding on and off

    (Taken from this post: Is there a keyboard shortcut in Eclipse to fold the current method/block? )

    0 讨论(0)
提交回复
热议问题