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?

4

4 Answers 4

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.

3
  • 4
    Thanks goodness for that. You have no idea how much you've helped! Thanks again.
    – Federer
    Commented Feb 4, 2010 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
    Commented Apr 5, 2016 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
    Commented Aug 1, 2017 at 10:18
56

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.

6
  • 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
    Commented Feb 2, 2017 at 2:45
  • Its single tab hosting both views, right? I cant drag that splitted view on 2nd monitor right?
    – Mahesha999
    Commented Aug 28, 2017 at 8:12
  • 2
    Just found Eduardo's answer. There is clone option in in Window>Editor?Clone, allows to drag to 2nd monitor.
    – Mahesha999
    Commented Aug 28, 2017 at 8:15
  • 1
    @Mahesha999 Good point. I have included your comment in the answer for more visibility.
    – VonC
    Commented Aug 28, 2017 at 8:19
  • @Mahesha999 Thank you for the edit: much clearer now.
    – VonC
    Commented Aug 28, 2017 at 11:11
8

For two tabs:

Window > Editor > Clone

For same tab (as shown above):

Window > Editor > Toggle Split Editor

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.