One of the more frustrating aspects about switching to MonoDevelop on the Mac after many years of developing with Visual Studio on the PC is the key commands. We all know that programmers are typists first, and programmers second so I’ve spent a good amount of time learning to do everything with the keyboard rather than the mouse.
The problem is I’m now hardwired to hit certain commands (ctrl+shift+b) when developing and it’s tough to fight that muscle memory. When I started using MonoDevelop, I would unconsciously start hitting the same key commands only to see them fail in various crazy ways.
Let me be clear that many of these issues are due more to how the Mac works than anything that MonoDevelop is doing. With that caveat in mind, here are some tips to get MonoDevelop on the Mac to behave a little more like Visual Studio.
The very first change you will want to make is map your keyboard control key to the mac command key. This will make simple actions like copy (ctrl+c) and paste (ctrl+v) work like a PC user expects. You can put it back to “normal” by using the following tip:
Tip: Go to System Preferences > Keyboard & Mouse > Keyboard > Modifier Keys > swap the Command and Option keys.
In VS.NET, I am forever pressing Shift + End or Shift + Home to select entire lines. Not having the Home and End buttons working on the Mac is a cardinal sin in my depraved PC mind. This one took some research to solve because there is no built-in solution. Luckily, there is a third party program that can help:
Tip: DoubleCommand is a free program that you can download on your Mac which allows you to configure your Home and End keys by setting “PC Style Home and End keys” on the dialog.
Bind Your Own
One awesome feature of MonoDevelop 2.2 is that it allows you to set the key bindings to whatever you like. For example, I’ve set ctrl+L to delete a line like it does in VS.NET since I use that command all the time. By default it executes “Go to line” in MonoDevelop, but it’s a great feature to be able to set your own key commands.
Tip: Under the MonoDevelop->Preferences menu, go to Key Bindings and set the keys to whatever you’re most comfortable with.
The Nuclear Option
If it’s all just too overwhelming for you. There is a small faction of the MonoTouch community that is pioneering the ability to open MonoTouch solutions inside VS.NET on the PC.
ManniAT has even created a stand-alone converter that you can use to open MonoTouch projects in VS.NET. It’s not quite there yet because you can’t compile on the PC, but he’s getting there. I actually used this solution to do some simple MonoTouch dev on my PC and it worked pretty well.
Tip: Open MonoTouch projects in VS.NET by using ManniAT’s converter.
The ultimate solution would be for someone to put together some VS.NET-like key bindings in a file that you can import into MonoDevelop. I haven’t been able to find this yet, and I’m not even sure if you can import key bindings into MonoDevelop, but I’ll cross my fingers because you never know what the Mono team or community will come up with next!
“I was trying to figure out which is the most important computer science course a CS student could ever take, and eventually realized it’s Typing 101.
The really great engineers I know, the ones who build great things, they can type.”
– Steve Yegge