At some point you’ll want to view the same class or file side by side. You may want to follow related code in different parts of the class or need some code constantly available as reference to change some other part of the class.
Eclipse allows you to split an editor and move it to anywhere in the editor area in the same window, including next to the original editor. Changes made in the one editor are reflected in the other. The feature isn’t very obviously named, but it is easy to use.
How to view the same editor side by side
To get the same editor side by side, select Window > New Editor and then drag the new editor next to the original one.
As an example, watch the video below to see how to split the editor and move it next to the original.
Notes:
- It may help to maximise the original editor first (Ctrl+M) to gain some screen space. You can then move the 2nd editor next to, above or below the original editor.
- It’s not that clear that you can drag the editor next to the other one, so watch the video carefully for the outline that indicates when you can drop the other editor. It’s not that easy to get it right the first time, but play around with the different positions to see what works for you.
- Changes made in one editor will reflect in the other one, but scrolling is (fortunately) independent.
Some keyboard shortcuts to help with this feature
Once you’ve got the editors side by side you may want to switch between them without having to use the mouse. To do this, press Ctrl+F6 once. This will switch between the last two active editors. In general, Ctrl+F6 cycles through all open editors, in order of the most recently active editor.
Tip: I’d also recommend mapping Ctrl+F6 to Ctrl+Tab by adding a mapping for the key Next Editor under Window > Preferences > General > Keys. It works a lot better than Ctrl+F6 since you can press the key without lifting your hands.
If you use often split editors, you may want to use the keyboard to split editors without using the mouse to activate the menu option. Here are two ways to do this:
- Go to Window > Preferences > General > Keys. Search for the key New Editor and enter any keystroke you’d like to use (eg. Alt+Shift+B, E). Recommended
- Alternatively, just press Alt+W, E. This uses the menu mnemonics to activate the New Editor menu option without having to remap any keys. This may not work if you have a plugin that registered another command under the Window menu with the mnemonic E or if mnemonics are affected by your OS settings. This should work most of the time, but for these reasons, the first method is recommended.
Related Tips
- The fastest ways to open editors in Eclipse using the keyboard
- Switch and close editors faster with the keyboard using Eclipse’s Quick Switch Editor
- Quick ways to navigate Eclipse editors using the keyboard
- More tips on how to work faster with editors.
Share this tip
Filed under: Editors, Maximise Screen Space, Navigation & Browsing, Window & Toolbar







That’s a nice solution, but still very cumbersome when you are used to EMACS’s C-x 2 (or 3).
Is there a fast way to switch between the two editors with a key-combo?
Thanks, OcasoProtal. I haven’t used the EMACS commands you mention, so I’ll assume you’re looking for a key to create the new editor without choosing the menu option.
You can map the New Editor command to a key combo under Window > Preferences > General > Keys. Search for New Editor and map the key to anything you like. Alternatively, just press Alt+W, E to invoke the menu command with menu mnemonics.
To switch between the 2 editors, use Ctrl+F6. I would recommend mapping this additionally to Ctrl+Tab (under Keys, the name is Next Editor). Copy the command and map it to Ctrl+Tab. It works better than Ctrl+F6.
I’ve got a post planned on editor navigation where I’ll discuss some of these points, but I’ll try and add them to this post as they are relevant. Thank you for raising them.
Let me know how it goes.
I’ve now updated the post with these shortcuts. Thanks again for the question.
Thanks for making this tutorial; the key mappings are especially helpful!
I made a split-view, but any new tabs I generate (e.g. by opening a file) end up on one side or the other. Do I need to repeat this process for each file, or is there some way to automatically make new tabs launch in both editors?
Thanks Matthew. Unfortunately, I suspect you’ll have to repeat the process for each new editor. I haven’t seen a way of telling Eclipse to open up editors automatically in split mode, but maybe someone who has will reply to this.
Regarding @OscasoProtal’s post, c-x 3 in emacs will open up a new editor *and* split the window all at once, which means that you don’t have to drag and drop the second window to have them side by side. Do you know if eclipse is capable of doing this?
Taras, by default Eclipse doesn’t support this. However, you can do this by installing the Emacs+ plugin that was suggested to me by someone while discussing another tip.
I don’t use Emacs+ personally, but have tried out this feature and it works quite well.
Once you’ve installed the plugin, you can just press Ctrl+X, 2 or 3 depending on whether you want to split it horizontally or vertically. Remember to first either (a) configure your key binding to the Emacs+ Scheme (as explained in their installation instructions) or (b) configure the keys manually using the keyboard shortcut tip I posted some time ago, using the command keys described on the Emacs+ homepage to configure the keys. I’d recommend option (b), ie. only configuring the ones you’re interested in first, unless you feel comfortable enough using the Emacs+ Scheme from the outset.
BTW, it has a lot of other Emacs features that you can use directly in Eclipse, so have a look at the homepage for other features.
Let me know how this works for you.