如何在 Eclipse IDE 中拆分和取消拆分窗口/视图?

2022-01-20 00:00:00 ide eclipse

如何在 Eclipse IDE 中拆分窗口/视图?我想在查看同一文件中的不同代码时编辑代码.

如果有一个技巧可以两次打开同一个文件,这可能会奏效,但我宁愿只拆分一个当前视图,而不是拥有两个相同的视图,这可能会让人感到困惑.

解决方案

这可以通过菜单项Window>Editor>Toggle Split Editor来实现.

当前拆分的快捷方式是:

"

  • 拆分编辑器是最古老和最受好评的 Eclipse 错误之一!错误 8009
  • 拆分编辑器功能已在 Bug 378298 中开发,并且将从 Eclipse Luna M4 开始提供.笔记与Eclipse Luna M4 的新闻价值将包含该公告.
  • How do you split a window/view in Eclipse IDE? I want to edit code while viewing the different code in the same file.

    If there is a trick to open the same file twice, this might do, but I would rather just split the one current view instead of having two of the same which might get confusing.

    解决方案

    This is possible with the menu items Window>Editor>Toggle Split Editor.

    Current shortcut for splitting is:

    Azerty keyboard:

    • Ctrl + _ for split horizontally, and
    • Ctrl + { for split vertically.

    Qwerty US keyboard:

    • Ctrl + Shift + - (accessing _) for split horizontally, and
    • Ctrl + Shift + [ (accessing {) for split vertically.

    MacOS - Qwerty US keyboard:

    • + Shift + - (accessing _) for split horizontally, and
    • + Shift + [ (accessing {) for split vertically.

    On any other keyboard if a required key is unavailable (like { on a german Qwertz keyboard), the following generic approach may work:

    • Alt + ASCII code + Ctrl then release Alt

    Example: ASCII for '{' = 123, so press 'Alt', '1', '2', '3', 'Ctrl' and release 'Alt', effectively typing '{' while 'Ctrl' is pressed, to split vertically.

    Example of vertical split:

    PS:

    • The menu items Window>Editor>Toggle Split Editor were added with Eclipse Luna 4.4 M4, as mentioned by Lars Vogel in "Split editor implemented in Eclipse M4 Luna"
    • The split editor is one of the oldest and most upvoted Eclipse bug! Bug 8009
    • The split editor functionality has been developed in Bug 378298, and will be available as of Eclipse Luna M4. The Note & Newsworthy of Eclipse Luna M4 will contain the announcement.

    相关文章