My favorite Eclipse shortcuts

This is a collection of Eclipse shortcuts I use often:

Mange Files and Projects

  • Alt+Enter: Show file properties of file open in the editor.
  • Ctrl+S: Save the current file.
  • Ctrl+Shift+S: Save all open files.
  • Ctrl+W: Close the current file.
  • Ctrl+Shift+W: Close all open files.
  • F5: Refresh selected workspace element with the local file system.

Continue reading

Yes you can: Diff with EGit in Eclipse!

In my previous post on how to quickly view all the changes between two branches in Git I ended with the statement “Is there away to do the same in Eclipse with EGit?“. I Googled around for the answer a bit, but with no success. By accident I just discovered how to compare the working version of a file to the commited version. Not entirely the same, but getting closer 🙂 For the purpose of being able to quickly check what changes I have made to write meaningful commit messages this is sufficient for me.

Anyway, these are the steps:

  • Open Git Staging (Window > Show view > Git > Git Staging)
  • Double click on a file in “Unstaged Changes” or “Staged Changes”

And voilà! There is a beautiful window with a side to side diff of the working version and commited version. Nice! I hope this is useful.

Wicked Shell is your friend: Using the shell from Eclipse

I am using the Git flow as my development model. It is very easy to understand and use. Keeps development nice, tidy and clear. See more information for links about Git flow.

When preparing a release the release or version number needs to be bumped (increased). This requires a shell script. I was switching to a command prompt to do this. Then I came across a nifty little plug-in for Eclipse, so I can execute the shell script from within Eclipse. It is called Wicked Shell. Continue reading

Enabling task tags in Eclipse

In Eclipse you can add a comment using Task Tags like // TODO <task> or // FIXME. This should add that comment as a task to the Tasks. By default the Task Tags are disabled. Enable them as follows:

  • Window > Preferences
  • Type Task Tags
  • Select that Task Tags under General > Editors > Structured Text Editors
  • Check Enable searching for Task Tags

Making a directory available to Eclipse

I was busy adding logging to a project today and added a logback.xml file to a resource directory under src/main. When running the application the logback.xml file was not being picked up. It turns out the resource directory must be added to the build path. A quick reminder how to do this:

  • Right click on the project
  • Select Build Path | Configure Build Path…
  • Select the Source tab
  • Click Add Folder…
  • Check the check box of the folder to add
  • Click OK
  • Click OK

Everything should be working now.