Browsing the archives for the eclipse tag.


Making xCode Behave like eclipse (sort of)

Uncategorized

So I do a lot of java development, but for my project work I am looking to do a whole whack of C and possibly Objective-C. So this means xCode and I must become friends. My problem with this is I really like the eclipse text shortcuts for deleting / moving / duplicating lines. Also I am just used to control + space for my auto complete, and option + shift + r for refactoring.

Having encountered this problem before in TextMate doing ruby stuff I assumed there would be a handy macro solution, this was not the case. So after some serious web searching I found several articles on how to solve a few of these problems. Some suggested I use ruby, other showed some neat hacking tricks with some keyboard plists, at any rate I won’t go into the how, you can find those (here, and here ).

I am simply providing my key bindings file for anyone who cares to use it.

What it does:

  • move line up: alt + up arrow
  • move line down: alt + down arrow
  • duplicate line down: alt + command + down arrow
  • delete current line: command + d
  • refactor current selection: option + shift + r
  • show auto complete: control + space

These function quite a bit more responsively than applescripts (based on my observations), however it will clear out your clip board so be warned, if anyone has any idea about that lemme know.

To install it simply place eclipse-style.pbxkeys in ~/Library/Application Support/Xcode/Key Bindings/ reboot xCode and you should be able to select the key binding file as shown in the screen shot below.

xCode Key Binding Prefs witth Eclipse-Style

xCode Key Binding Prefs witth Eclipse-Style

Hope this helps, sure makes coding in xCode more fun for me, and helps with the context switching between Eclipse and TextMate and xCode.

.joe

No Comments