Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse keyboard shortcuts for compare/diff view?

When I am comparing two files in Eclipse (using, for example, "Compare With" --> "Local History"), what keyboard shortcuts are available?

I would like to be able to go to the next/previous diff and copy the selected diff left without having to click the tiny little buttons.

Thanks!

like image 469
David Wolever Avatar asked May 25 '09 15:05

David Wolever


People also ask

How do I switch between views in Eclipse?

By pressing Ctrl+F7 once, Eclipse switches between the currently active and last active view.

What is Ctrl Shift G in Eclipse?

Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.

What is Ctrl Shift L in Eclipse?

About Shortcuts The Key Assist action which can be invoked by clicking Ctrl + Shift + L shows us all the accelerators or shortcut keys available in Eclipse.

What does Ctrl k do in Eclipse?

In Eclipse, if the cursor is over a word and you press Ctrl + K you will jump to the next occurrence of that word in the file.


4 Answers

To complete Artem's answer, after Preferences->General->Editors->Keys, search for:

  • Select next change
  • Select previous change
  • Copy from Left to Right
  • Copy from Right to Left

All those keys in the "Compare" section have no shortcut assign by default, so you can add the ones of your choice.

http://rubenlaguna.com/wp/wp-content/uploads/2007/08/comparebefore.png

like image 100
VonC Avatar answered Oct 04 '22 02:10

VonC


Set your own keys as instructed by @Artem and @VonC.
In Eclipse Galileo, however, the path is Window > Preferences > General > Keys.

For each command you wish to set:

  1. Click on the Command Name
    TIP: Sort by "Category" to group all "Compare" commands.

  2. Click on the "Binding" textbox
    Then, select the keys you wish to use, Eclipse will record them for you.
    TIP: You can enter a sequence of keys in addition to key combination(s).

  3. Set "When" drop down box to "Comparing in an Editor."
    TIP: This setting will limit your hot key(s) to only be activate in the chosen context.


Intuitive Hot Key settings: (my recommendations, not from a standard)

  • Copy All from Left to Right Ctrl+Shift+Left, Ctrl+Shift+Right
  • Copy All from Right to Left Ctrl+Shift+Right, Ctrl+Shift+Left
  • Copy from Left to Right Ctrl+Left, Ctrl+Right
  • Copy from Right to Left Ctrl+Right, Ctrl+Left
  • Select next change Ctrl+Down
  • Select previous change Ctrl+Up
like image 40
Jeremy D Turpin Avatar answered Oct 04 '22 02:10

Jeremy D Turpin


With eclipse, when you are in a window and you have a button to do a action but this button doesn't have a tooltip to show you his shortcut, go to Navigate menu. The most of time, shortcuts are shown there.

enter image description here

like image 32
zatenzu Avatar answered Oct 04 '22 02:10

zatenzu


Actually you can define whatever you want to be a short cut for this. Preferences->General->Editors->Keys. EDIT: For some reason I don't see that option appears there. O_o

like image 43
Artem Barger Avatar answered Oct 04 '22 04:10

Artem Barger