81

Perhaps this is a trivial question, however it's something that is seriously annoying me. I'm editing someone's program at the minute and one of their .java files is absolutely massive. I'm trying to edit it at the moment, whilst referencing it as well.

Is it possible to split the screen in Eclipse, to allow a split view of the same file?

Federer
  • 33,677
  • 39
  • 93
  • 121
  • 1
    Starting with Eclipse 4.4 M4, it is now possible! See [my answer below](http://stackoverflow.com/a/20566306/6309) – VonC Dec 13 '13 at 12:16
  • This is a duplicate of a later question with better, more contemporary answers: [How do you split a window/view in Eclipse IDE?](http://stackoverflow.com/questions/9471578/how-do-you-split-a-window-view-in-eclipse-ide) – Andy Thomas Jun 30 '15 at 20:40
  • @AndyThomas I think you mean the newer question is a duplicate of this one. – SnakeDoc Jul 02 '15 at 19:20
  • @SnakeDoc - No, I mean the two are duplicates, the newer one has better answers, and [the old one can be closed as a duplicate of the new one](http://meta.stackexchange.com/questions/147643/should-i-vote-to-close-a-duplicate-question-even-though-its-much-newer-and-ha/147651#147651) – Andy Thomas Jul 02 '15 at 19:24

4 Answers4

92

A. Window -> New editor

or (slightly quicker)

B. Right-click on the tab with the code you want to see in another split view and choose "New Editor" to duplicate this tab in the same editor window (i.e. without having to open a completely new editor window as in A.)

Then drag the new tab to the right until you see an arrow, then lift your finger. Doing it this way the two views will be in sync: everything you change on the left will change on the right.

Alberto Zaccagni
  • 30,779
  • 11
  • 72
  • 106
  • 4
    Thanks goodness for that. You have no idea how much you've helped! Thanks again. – Federer Feb 04 '10 at 10:25
  • Only works prior to Luna. The closest equivalent behavior in Luna is to do Window>Editor>Clone. This creates a second tab with the file, which can then be dragged to a split view as before. Or use @VonC's answer. – Quantum7 Apr 05 '16 at 10:29
  • 1
    This does only work prior to Luna as @Quantum7 says, but see @VonC's answer below - i.e. `Ctrl+_` for horizontal split, and `Ctrl_{` for vertical split (Also available from the menu via Window>Editor>Toggle Split Editor \((Vertical|Horizontal)\) – SteveR Aug 01 '17 at 10:18
54

Lars Vogel just announced (December 2013) in "Split editor implemented in Eclipse M4 Luna" that is is now possible possible!

Split editor implemented in Eclipse M4 Luna 4.4

This solves 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.
Current shortcut for splitting is:

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

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

As commented by mahesha999, there is a clone option in menu Window > Editor > Clone which opens separate cloned window/tab (instead of split view inside the same tab) that can be dragged to the 2nd monitor.

Mahesha999
  • 22,693
  • 29
  • 116
  • 189
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 3
    I think I voted you up two years ago. I needed this again and was going to vote you up. But unfortunately I can't vote up twice. – Greeso Feb 02 '17 at 02:45
  • Its single tab hosting both views, right? I cant drag that splitted view on 2nd monitor right? – Mahesha999 Aug 28 '17 at 08:12
  • 2
    Just found Eduardo's answer. There is clone option in in `Window>Editor?Clone`, allows to drag to 2nd monitor. – Mahesha999 Aug 28 '17 at 08:15
  • 1
    @Mahesha999 Good point. I have included your comment in the answer for more visibility. – VonC Aug 28 '17 at 08:19
  • @Mahesha999 Thank you for the edit: much clearer now. – VonC Aug 28 '17 at 11:11
  • Took me awhile to find this answer. But Ctrl + { does not work for me. I bet its something with keyboardlayout, seem to remember somethinbg similar with another shortcut. I concurr with previous commenters above. Doing this should be a no-brainer. – brat May 26 '20 at 17:13
8

For two tabs:

Window > Editor > Clone

For same tab (as shown above):

Window > Editor > Toggle Split Editor

Eduardo Moreno
  • 121
  • 2
  • 7
2

I have implemented small plugin which can split view for any eclipse based editor and make a video have it's work, see video here http://www.youtube.com/watch?v=61yJF7LQ-bE. This plugins part of jboss tools, but can be installed. With it you can split editor view just by clickin CTRL+8 or window->New Editor(Side By Side).

Maksim Areshkau
  • 151
  • 1
  • 2