Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - Same .Java file in split view?

Tags:

eclipse

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?

like image 420
Federer Avatar asked Feb 04 '10 10:02

Federer


People also ask

How do I open the same file twice in Eclipse?

To get the same editor side by side, select Window > New Editor and then drag the new editor next to the original one.

How do you split in eclipse?

Multi Editor-based Usage: Open a file in Eclipse, then select Window -> New Split Editor from the main menu to open a split editor of the file.

How do I duplicate a Window in eclipse?

On the Window menu choose Editor , then Clone (since 4.4. x) or New Editor (earlier versions). You can then drag the title bar around to get side-by-side views.


2 Answers

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.

like image 154
Alberto Zaccagni Avatar answered Sep 20 '22 13:09

Alberto Zaccagni


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.

like image 44
VonC Avatar answered Sep 21 '22 13:09

VonC