Anything similar to Emacs' buffer/window support for Eclipse? - eclipse

I'm trying to make the switch from Emacs to Eclipse. One thing that seems to be missing is its buffer/window support.
I know in Eclipse I can drag an editor's tab title over to split the view, creating the equivalent of a new Emacs window, which is a step in the right direction.
I can't find any key bindings for this functionality, though. Ideally, I'd like to be able to set keys to split horizontal, split vertical, switch to next (there is a next editor, but I want the next window/whatever you call it), switch to previous, close this window split (not this editor), close all other editor window splits.
As it is, the only way I've found to close a split pane is to drag all the files over one by one until none are left. Things like this make working with split screens tedious in Eclipse.
Any help would be appreciated, hopefully there's something simple I'm missing.

Emacs+ has this exact behavior for Eclipse: http://www.mulgasoft.com/emacsplus

According to the keys preference there is an unbound command to open a new editor, which would open another tab rather than split the view. There is also an unbound command to close all other editors. Ctrl+W will close the current editor and Ctrl+F6 will switch between tabs. You can bind or rebind these to be closer to their Emacs equivalents. Alternatively there is an Emacs key map which you may find more helpful. Unfortunately I don't it's possible to split the view from the keyboard.

Try Ctrl-Tab and Ctrl-Shift-Tab for cycling through tabs (buffers) and Ctrl-F4 for closing a tab. You can also look through the shortcut bindings in the eclipse configuration.

Related

Move Eclipse's Find/Replace dialog to a view?

I find Eclipse's (Eclipse 3.7, Indigo, running under Mac OS X 10.6.8) Find/Replace floating dialog box to be very annoying. Part of the time it ends up obscuring the search results. Is there any way to have Eclipse move the Find/Replace somewhere else? I'd like it to be a pop-up view, as I often do with the Console, Servers, Outline, and other views. However, if it could be incorporated into the view which it's searching, that would be great, too.
Eclipse's Find / Replace dialog is a dialog, not a view, so you can't drag and drop it to one of the view areas.
Here's a Eclipse search plugin that might work for you. Scroll all the way to the bottom of the page to get the Software Update link.
Worst case, you could write your own Eclipse plug-in that creates a view that does a Find / Replace.
TL;DR
Find/replace cannot be used as a view. Here are two ways to find text without obstructing the search:
Use incremental search (CTRL+J)
Use the quick search plugin (CTRL+SHIFT+L)
Pros and cons
Both approaches behave differently from the traditional find/replace and may require some getting used to.
Approach 1.
It works out of the box, no need to install a plugin, but it (currently) does not support pasting nor searching for the current selection (but there is CTRL+K for the latter). You can use UP and DOWN or repeat CTRL+J or CTRL+SHIFT+J to jump between matches.
Approach 2.
This still opens a dialog, but one which integrates the search results rather than obscuring them. I suggest resizing it to have a good preview size.
The default shortcut shadows the "Show Key Assist" original, but this can be changed. It is an extra install and AFAIK only supports case sensitive searches, but it supports searching for the selection and pasting.
It shows matches across files, starting with the top open editor (if you have more than one visible, e.g. side by side, it sometimes does not start with the one you were last on). You can move between matches with UP and DOWN and hit enter to go back to the editor on the selected match.
NOTE
I suppose on OSX you can replace CTRL with CMD in keyboard shortcuts above to achieve the same, but I could not test it. The shortcuts can be customized in Preferences->General->Keys

How Do I Switch Between Multiple Eclipse Windows (in "Split Screen" Mode)

Eclipse allows you to open more than one text editing "window" at a time to get a "split screen" effect. This is great, but the problem I'm having is that there doesn't seem to be any way to switch between these windows, directly.
Now, you can use the usual commands (Ctrl+Page Down, CTRL+e, ALT+RIGHT, etc.) to switch between specific buffers. In other words, if I have window 1 with A.java and B.java open, and window 2 with C.java open, I can use Ctrl+Page Down to go from A, to B, to C. However, I can't just go from A or B (ie. from window 1) in to C (ie. to window 2), unless I use CTRL+e and type in "C.java".
There are half a million Eclipse commands though, and they're certainly not all labeled consistently, so it's quite possible I'm just failing to find the relevant command. Does anyone out there in SO-land happen to know it?
By default, its Ctrl+F6. However, its useful if you map you keys to Ctrl+Tab to switch between open editors like Windows.
You can change your preferred keys in Window>Preferences>General>Keys and change "Next Editor" to any key of your choice(Ex: Ctrl+Tab). Hope this is what you needed.
This can be achieved easily if you are using Vrapper in Eclipse. Vrapper
is a Vim plugin for Eclipse. If you are trying to maximize your productivity in Eclipse like we all are, it's well worth the try.
Once you got it installed, check out the Split Editor Plugin for Vrapper. You can then create splits on the fly and switch between them using the standard Vim shortcut: Ctrl-w w
Bonus: don't forget to maxmize your editors using Ctrl-m. If your editor ever loses focus for some reason, regain it by pressing Ctrl-F12
Finally open any file in your project using Ctrl-Shift-r
Edit from anula comment:
A useful thing to mention here: Ctrl-w by default binds to closing window, so if you want to use it as in Vim you need to first go to Window->Preferences->General->Keys and unbind "Close".
You can install the HandySplit plugin from Eclipse Marketplace and bind its 'Toggle focus between split editors' command to any keyboard shortcut you like.

What are the shortcut keys to change to the next and previous tab in Eclipse on Mac OS X?

I want to be able to switch from one file to another in the Eclipse editor (in the Java perspective) from the keyboard (and bind those key combinations to buttons on my mouse). What are the shortcut keys for switching the current tab to the next or previous?
Mac OS X:
Fn+Cntrl+↑
Fn+Cntrl+↓
Effectively Cntrl+page up/page down as given in the first comment for #wibbe01's answer.
According to this thread, switching editors are:
Shift+Command+F6
Command+F6
, which you can remap to:
Shift+Command+Tab
Command+Tab
Note, as mentioned in that same thread:
Command+E lists all the opened editors, allowing to quickly select one
Shift+Command+L lists all the active key bindings.
The bug 86248 helped introduced the Cntrl+↑ and Cntrl+↓, which Bjorn Tipling reports working on Mac with a Fn in front of it.
If I were you I would just go to the eclipse menu, then preferences. Under the general section of the tree there is a section called "Keys" In there you will find things for "Next Editor" or whatever other keyboard shortcuts you are looking for. Map them to what makes sense to you....then you're happy like this :) or maybe even like this :D.
Enjoy.
In Eclipse's preference panel, go to Keys. The command is called Next Tab and Previous Tab, just map these to whatever you want. In my case since I normally use mvim are:
⌘+⇧+[
⌘+⇧+]
You can change all shortcut keys in preferences by pressing ctrl+shift+L 2 times . Switching tab in Eclipse (ctrl+F6) is not easy to press. So you can make it ctrl+tab or whatever you want.
Since I have my F keys mapped to the default setting, I had to use fn-command-F8
I figured it out by first confirming command-F8 was indeed mapped under command-shift-L

Navigating the Content Assist List in Eclipse

Here are the ways the Eclipse documentation states you can navigate the Content Assist list:
You can use the mouse or the keyboard
(Up Arrow, Down Arrow, Page Up, Page
Down, Home, End, Enter) to navigate
and select lines in the list.
But all of the options require you to move your hands significantly away from their natural place on the keyboard!
Are there any other, quicker ways I can navigate this list? Something like tab, or the j/k from vi?
This is a great feature, and you can implement it like so: bind movement keys in Eclipse's key binder and then use them in the content assist menu!
Preferences/General/Keys
Line Down: Bind to Ctrl+K
Line up: Bind to Ctrl+I
(both when 'Editing Java Source')
and then try moving with Ctrl-K/I when the content assist pops up!
In Kepler, as jed mentions in the comments, select "when editing text" instead and it should work.
If you try to fill in the content manually, Eclipse will move.
The search is quite advanced, e.g. "ArL" can match ArrayList, etc., so if you know what you are looking for, instead of navigation you could use search.
This is certainly not a solution for everyone, but if you switch to the Emacs keyboard layout you can just use the key bindings for the "previous line" and "next line" commands, e.g., Ctrl-P and Ctrl-N.

Is it possible to dock the "Find/Replace" window in Eclipse?

I could have sworn I saw it once before in a screencast where someone had the find/replace window docked in their Eclipse environment.
However looking through the list of options in "Window > Show" the closest thing I can find is the Search window.
I find that I use it quite a bit and with larger monitors these days I figure I could afford to have it open in my perspective all the time.
Is this possible?
Thanks.
One poor-man's workaround is to dock a view that you don't need in a part of Eclipse where you want the find/replace view and then place the find/replace dialog on top of that like this:
Clearly this is a huge kludge but it does work.
I am not sure about that, since Fast views are:
icons allowing users to quickly display different views that have been created as fast views
And the search/replace is a Dialog, not a View..
(source: bpsite.net)
(That Dialog box is not like Views, which support editors, also have their own menus. Some views also have their own toolbars.)
The help page mentions:
Fast views are hidden views that can be quickly opened and closed. They work like other views except they do not take up space in your Workbench window.
This might not be an exact answer for the question. But this works like a charm.
Press ctrl + j and keep typing...
Use ctrl + k to go on
Use shift key wherever required.
Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.