There are times when you just have to bite the bullet and do some real coding with Xcode. Here are some tips to make it ‘feel’ more like MSVC (with Visual Assist installed of course) so you can bounce back and forth without snapping and murdering your family again.
Step 1: Get rid of that horrible funky mouse acceleration and fix cut and paste
Setup Synergy+ so you can use your Windows mouse and keyboard on your Mac. It’s free.
Just think of your Mac screen like an extra monitor.
Note sure if you’ve heard but the Ctrl-X/Ctrl-C/Ctrl-V shortcuts are freakin’ backwards on the mac. (Don’t get mad Mac people, I just mean from a long-time Windows user’s point of view!)
To fix this, open the Synergy settings on the server side, which would be Windows, and set up the Mac target to reverse the Ctrl/Alt buttons. (See pic above)
This makes the fix system wide, much better than just trying to fix Xcode specifically to do it.
Advantages of using Synergy:
- No switching keyboards/mice! Switching keyboards can kill productivity.
- Saves desk space and looks cool
- You can cut and paste text between the OS’s
- If you’ve got a linux box, you can also set that up with Synergy
- Need two machines running all the time for this to work
There are free methods to get rid of that nasty acceleration, none of them really work, maybe the $$ ones do. Some 3rd party mouse drivers will do the job, but you have to OWN that mouse for it to work right.
You can also reverse the Ctrl/Alt (Sorry, Command key, whatever) under keyboard preferences on the Mac side, but I seem to remember having a problem with doing it that way.
Step 2: Use my MSVC key binding set
Install my MSVC key config. (Works fine with Xcode 3.x)
Download this, unzip it, and place MSVC.pbxkeys in YourUserName/Library/Application Support/Xcode/Key Bindings.
Next, start Xcode and click Xcode->Preferences, select Key Bindings, then choose “MSVC” as your key binding set. Now Ctrt-Shift-F does project wide find, Ctrl-Shift-H does project wide replace, F5 does build and debug, Ctrl-` (tilde) will swap between source/header and so forth.
It also remaps debugging keys, F10 will step over, F11 will step into, etc.
It’s not perfect though, it doesn’t seem to want to map a key twice, I can’t get F5 to also “Continue” while debugging. So that became F6.. consider this a good place to start from that you can further customize.
Step 3: Fix Firefox so Home/End works like you would expect.
You’ve gotta websurf from your Mac once in a while, so install Firefox so you don’t have to deal with Safari.
Install Keyfixer, a Firefox 3 plugin so pressing End or Home while editing text will actually do what you expected it to.
While you’re at it, you can fix it so your mouse’s forward and back buttons work properly in Firefox by using the hotkey mapper in Synergy on the server side:
(Map mouse button 4 to Ctrl-L and mouse button 5 to Ctrl-R)
Step 4: Finding a decent SVN client for your Mac
Well, you can’t. The gold standard is of course TortoiseSVN on Windows – but I can’t find anything close on the Mac yet, at least not for free. Yeah, I’m cheap like that.
SCPlugin shows a bit of promise because it attempts Finder integration but is currently broken enough to steer clear of. Maybe later…
RapidSVN is reliable but makes you jump through some hoops if you want merging/diffing.
What works for me currently:
- Place the SVN checkout on a networked Windows drive so I can use TortoiseSVN. Xcode will behave fine working directly from it – you can override where projects gets built in Preferences->Building so that part happens on the Mac side. (Faster, and less worry that permissions will be screwed up when you do your final install)
- Also enable the SVN support in Xcode, it’s.. uh.. not the greatest but better than nothing.
Step 5: Relax and enjoy your MSVC like coding environment
Well, almost. You’ll still feel a little empty inside without VisualAssist’s advance code refactoring abilities, but hey.
If you’ve got any more tips to ease the Win->Mac pain please share ’em.
Pingback: Make Xcode Feel Like Microsoft Visual Studio | iPhone Development Tutorials and Programming Tips
Thanks for the tips, and especially for pointing out Synergy. I’m anxious to try them out.
Thanks so much! This is most of the recipe I’ve been using. The keys were driving me nuts (ctl+alt+p for continue – totally intuitive).
Pingback: Common pitfalls of iPhone development « RasterGrid Blog
Like the tips. I have a few comments: Have you tried svnX? I use that for my subversion client. My subversion repository is on my Windows PC (I use Apache as my SVN server). I steer clear of using Windows shares, since I’ve found that unless I remember to eject the shares before my mac goes to sleep, the finder completely locks up when I wake my mac up. I’d really love an answer to that. One final thing, DNS names are causing me a whole amount of grief. I’d like to use DNS for web sites on my PC – I don’t like IP addresses. The mac refuses to talk to a DNS server – so I use a hosts file.
Darek – svnX – yep, I’ve used it. Probably my favorite free mac client, but still light years from Win’s TortoiseSVN.
You know, I have had my mac refuse to wake up probably three times in the last six months. It hibernates every night and never eject shares but it sounds like it’s related to what you mentioned.
Thanks for this post. I was really struggling with the default XCode bindings after over a decade of Visual Studio development. Heck, all I really wanted was the ‘home’ and ‘end’ keys to do what I was used to! Over the last couple of weeks I probably hit one of those keys while editing a line a hundred times, only to find myself at the top or bottom of the file.
After using netbeans and visual studio for couple of years, I found, that xcode really suxs:/ Mac is extremely programming unfriendly.
Anyone have an update for this that works with Xcode 6? I had trouble getting this to work. It seems like it is a different file type now. (.idekeybindings)