How do you split and unsplit a window/view in Eclipse IDE?

EclipseIde

Eclipse Problem Overview


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.

Eclipse Solutions


Solution 1 - Eclipse

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:

https://bugs.eclipse.org/bugs/attachment.cgi?id=238285

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.

Solution 2 - Eclipse

You can open a new editor from the Window menu.

This will give you your current editor once again.

Solution 3 - Eclipse

If you right click on one of the tabs, one of the options should be New Editor (for me, it's at the bottom). Select that, and then drag the new tab onto the bottom scroll bar of the code editor, which will split the editor panel in two.

Solution 4 - Eclipse

Just click and drag editor title to left, right, top or bottom

Solution 5 - Eclipse

I tried the above solutions in Eclipse Luna 4.4.1 but couldn't open two (or multiple editor windows for different files side by side).

Simplest Solution:

  1. Open all files you want in a single window.
  2. Drag the tab of each of the files to right or to the left, eclipse will automatically display a split screen display and will split the editor into two windows once you leave the mouse button.
  3. repeat for each file/tab.

Happy Coding!

Solution 6 - Eclipse

Side by side editors in single Eclipse window.

  1. You have an Eclipse window showing a single editor.
  2. Window -> new editor. You now have two editor tabs.
  3. Click and drag one tab towards the right and a green outline of a vertical screen appears (drag tag towards the bottom and an outline of a horizontal screen outline appears). You can let go as soon as the outline appears.
  4. Open file of choice in 2nd editor (recent files show up at bottom of file menu).

ADT/Eclipse:Build: v22.3.0-887826

Solution 7 - Eclipse

You might want to check an eclipse plugin called HandySplit

It allows to split an editor into two and move tabs from one editors stack to another with keyboard shortcuts only.

That works on Eclipse Juno or higher. For the previous Eclipse versions check this out

Solution 8 - Eclipse

Simply go to Window > New Window

This will open up a new window of the same Workspace in eclipse.

You can open up separate files in each Window.

Solution 9 - Eclipse

Below are the steps to split editor horizontally or vertically go to:

Window -> Editor -> Toggle Split Editor (Horizontal) 

to split editor horizontally or

Window -> Editor -> Toggle Split Editor (vertical) 

to split editor vertically.

It will open two editors side by side or will pileup tow.

Solution 10 - Eclipse

If you want to see two different files in same eclipse you can,

> Right-click a tab -> Detach

Now you can see both files at the same time without opening new eclipse and you can drag and reatach to tabs again.

Solution 11 - Eclipse

On Mac OS, the key combination to toggle spit/unsplit for horizontal split is ⌘ ⇧ - ("cmd"+"shift"+"-"), whereas for vertical split, it is ⌘ ⇧ [ ("cmd"+"shift"+"[")

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionXonatronView Question on Stackoverflow
Solution 1 - EclipseVonCView Answer on Stackoverflow
Solution 2 - EclipseDerMikeView Answer on Stackoverflow
Solution 3 - EclipseMichael MorganView Answer on Stackoverflow
Solution 4 - Eclipseasok BuzzView Answer on Stackoverflow
Solution 5 - EclipseAhmed OsmanView Answer on Stackoverflow
Solution 6 - EclipseStephen W. WrightView Answer on Stackoverflow
Solution 7 - EclipseakikhtenkoView Answer on Stackoverflow
Solution 8 - EclipseAllanView Answer on Stackoverflow
Solution 9 - EclipsemncView Answer on Stackoverflow
Solution 10 - EclipseRohith MuraliView Answer on Stackoverflow
Solution 11 - Eclipseauspicious99View Answer on Stackoverflow