Is there a shortcut to switch between panes in the Eclipse Compare view? - eclipse

When I compare two versions of a source file (for example, from egit) in the Eclipse IDE, the Compare View is appeared. It has two panes containing two versions of a text and I can use keyboard to move cursor through the text on one of this panes (or even edit the text in it). Additionally, I can use special shortcuts to go to the next/previous difference and/or apply current change from/to the opposite pane. But, I didn't find a way to move the input focus to other pane.
Actually, I would like be able to do this in one case. Let's say, I compare two revisions of a source and I need to apply some changes while others are unneeded. To achieve this, I walk through changes using the Ctrl + , or . shortcuts and apply needed changes using, for example, the Ctrl + Shift + ,. It looks like all is OK, but if I reach a change which has no any text in the current pane, the applying shortcut does not work. For example, the cursor is on the left pane. I went to the next difference and this difference is concluded in that the text was, for example, added in this line. So, the Compare View will show this added text on the right pane, will highlight it with the special rectangle while this rectangle on the left pane will have zero height and the cursor will be placed under this zero-sized rectangle. I.e., outside of it. So, I think, exactly this thing causes that the current change applying does not work. When I click on the opposite pane, inside of this change and then use the change applying shortcut, it works fine. So, I would like to switch to other plane via shortcut, not using mouse.

Related

Enable clicking on the Green circles in Eclipse to jump to code

How can I enable clicking on this bubble (or perhaps the name) to instantly jump to the underlined place in code? By pressing f2 and clicking on a small box, the same effect can be achieved, but I remember being able to work far faster doing this on one of my old projects.
Hold Ctrl and hover over the method name. You can then choose to jump to the declaration or super implementation.

Split windows in Netbeans

I'm trying to split my windows so I can have 2 different classes or whatever on 1 screen but it will only split the window of the same class/file/whatever. I've been using netbeans for years and still can't do this.
Is this possible?
You don't specifically mention which version of NetBeans you are using. I'm using version 8, and these instructions work for that version and version 7. I believe it is the same for version 6.
If you want to see two different source files on the screen at the same time (without floating), then open both source files. You will have two tabs in the editing area of the IDE. Click on the tab of one of the source files without releasing the mouse button (and without holding any additional keys), and drag toward either the right side of the editing area, or toward the bottom of the editing area (depending on whether you want them side-by-side or stacked). You will see an orange outline appear once you start dragging. If the orange box encloses the entire editing area, then the IDE thinks you want to reorder the tab. Keep dragging toward the edge (without going over) and eventually you will see the orange box change to fill either the right half or the lower half (or if you drag the other way, the left half or the top half) of the editing area. Releasing the mouse button at this point will drop the source file in that half of the editing area, leaving you with the two source files side-by-side or stacked.
Here's an example of what it looks like when stacking two source files, just before the mouse button is released:
And here is what it looks like after releasing the mouse button:
If you want to have the same source file duplicated on the screen, open the single source file and follow the instructions above, only hold the CTRL key while clicking-and-dragging.
You can repeat this procedure as many times as you want (as is practical for your screen size), so that you end up with source files in several columns, several rows, or any combination thereof.
When you next open a file, it will be opened in the tab group of the currently selected source file. If you end up with a source file opened in the "wrong" tab group, just drag it to where you want it using the procedure above (allowing the orange box to outline the whole tab group area if you want to drop it in as a tab).
Additional screen shots for reference...
Reordering a tab within the same tab group:
Side-By-Side instead of stacked (two images):
Get as crazy as you want...
Create the above by dragging the second file to the lower half, the third file to the right half of the top half, and the fourth file to the right half of the lower half.
At least in netbeans version 8.1, you can ctrl + i and write "move window".
This will allow you to move the window with the arrows, it is the same as some user posted before but using the keyboard instead of the mouse (I prefer keyboard for this kind of things while I am coding).

how to change the view of open files list in netbeans 7.3.1

When I open, say a 10 or more file in Netbans 7.3.1 (windows 7), Netbeans puts each opened file's name in a a tab and all tabs are listed horizontally above the code eduitor. And at the end of that horizontal list, Netbeans provides clickable arrows (>,<,V ) to kind of navigate that list.
Since many times, the file that I want to get into is not visible in that horizontal tab list, and I need to navigate to the left or right, I usually end up clicking on the down arrow (v) and that gives me the full list of all the open files. At that time, it's a simple click to go to that file. I wish that list was available to me in a vertical fashion without an extra step.
Is there a way to see that vertical list at all times? For example, where the HTML navigator is...
I don't believe NetBeans can do this as you describe.
However, what you may find useful is Ctrl-Tab - pressing this once brings up the open file list and pressing Tab repeatedly iterates through these files. Ctrl-Shift-Tab iterates in the other direction. Letting go of Ctrl selects the currently selected file. This is similar to the Alt-Tab feature in Windows.
Hope this is useful.

How can I scroll left and right in Eclipse editor with the keyboard without moving the cursor?

To scroll within the Eclipse editor without moving the cursor up and down one can use CTRL+Down or CTRL+Up. But what about left and right?
It is not possible. If you search keys in Eclipse's Preferences, you will find out that you only have Scroll up and Scroll down that you can set hotkeys on.
My recommendation would be changing the maximum line length in the editor.
Make your code shorter. After all, looooong lines of code are not so readable.
Also, resize your editor area. If you feel strangled, remove the Outline, TaskList, and Build view from your right side of Eclipse, and enlarge the editor.

How can I go to the next Eclipse marker (e.g. build error) using the keyboard?

Suppose I make a method signature change that breaks several callers, and I want to review the call sites manually to update them.
Once I change the signature, my "Problems" view shows, say, a dozen errors.
What keys can I hit to navigate through them while leaving the keyboard focus in the editor for fast fixups?
(It's been a while, but I think the Visual Studio equivalent is F8.)
Note that this question does not duplicate Eclipse: How to go to a error using only the keyboard (keyboard-shortcut)?, as that one seeks to navigate only between markers in the current file. In this case, I want to go to the next error regardless of which file it's in.
("Marker" is the general Eclipse term for errors, warnings, etc.)
The best I've come up with so far is Ctrl + F7 to flip to the Problems view, then ↓ to pick the topmost error, then Enter to go to it (which returns focus to the editor).
Here's a way to move to the next error, regardless of editor, in one keystroke. It's not perfect, but it works until it's fixed in Eclipse.
Open a "Markers" view. Click the down arrow at the top right, and choose "Configure Contents". Uncheck the show all box, and create the view to show only the problems you want to see. You'll probably want to deselect "warnings" and "errors" as well. Save it.
Click the same "Markers" down arrow, and choose "Group By". Select "None". This is important because you don't want the parent tree level nodes to show, otherwise some of your "next" actions will take you to those, which don't represent an error.
In Eclipse -> preferences -> keys, search for "Markers". If there is not a keystroke bound to the Markers view, create one. I use Ctrl + Shift + M
Get a keyboard hotkey tool like AutoHotKey (for PC's) or iKey for the Mac. I'm using iKey, but there are plenty of other Mac tools you can use. In your hotkey tool, define an action for the keystroke you want to use for "next error". I chose the standard CMD + .
For that keystroke/action in your hotkey tool, generate 3 keystrokes in the following order:
Ctrl + Shift + M
Down arrow
Enter
Of course, you'll want to change the first one to whatever you picked for yours. You'll probably want to restrict that action to be executed only when Eclipse is the current application.
Save that, create some compile errors, and test it.
Try Ctrl + 3 for Quick access popup window.
If the "Markers view" is not already visible, then type in "markers", in the searchbox on the popup window. Once you have selected it, it should stay available, when you press Ctrl + 3 the next time around.
I just had the same problem, after refactoring some parts of code. I had a lot of errors in different files and i had to go through all of those.
I used the following solution:
Mark all (relevant) entries in the Problems view.
To do this switch to the Problems view using Ctrl+F7 and select the entries with Shift+↓/↑
You can also select all entries using Ctrl+A
Open the marked errors by pressing ↵.
Every file containing at least one marked error will be opened.
The cursor will automatically select one error/file, as if you open only this specific entry
Fix the errors in the opened file.
Here you can use Ctrl+. to navigate to next error inside this file
Close the file using Ctrl+W when your done.
Eclipse will automatically focus the next file and you can go back to step 3
In my case this solution was much faster then switching to the Problems view each time.
There's an Eclipse bug entered for this that has an attachment that looks like it does what you want.
You could use AutoHotkey:
save the mouse position, send a mouse event to click on the arrow in CDT console and then return the mouse back to it's original location. Record the mouse coords with window spy or use autohotkey's search by image function (first capture the images of two arrows with printscreen into bitmaps).