Everyone has their own workflow and choice of Scripting IDE, but if you’re one of those using MonoDevelop with Unity this blog post should help with an increase in efficiency when working with it..
I’m using a Mac and so the workflow improvements will be based on using MonoDevelop on a Mac.
Syntax Highlighting is important for writing and reading code, MonoDevelop makes it easy to change this, simply click on MonoDevelop-Unity menu item and then click Preferences, the Preferences window will open, there’s a menu on the left hand side, under Text Editor -> Select Syntax Highlighting there will appear eight options for you to chose from. My preference is called Oblivion but pick and test one for yourself which suits you best. You can also enable semantic highlighting which helps with reading code. Use cmd + / – to zoom in and out, so you can see the code you are writing.
Who doesn’t like a good keyboard shortcut, yes there’s many to remember from many different software packages we use, but I think it’s important to have a few for each package that are your most important to your workflow. So here’s a few I feel worth highlighting for an increased workflow:
- cmd + S = Save Script – Unity picks up this save and recompiles to reflect the changes
- cmd + shift + S = Save all scripts open, useful if you’re manipulating multiple scripts when coding public / public static functions etc
Scripting layout :
- cmd +[ and cmd + ] = Indents code, allowing to quickly indent lines of code without having to use the tab key
- cmd + / = Quickly comment out some code or comment your comments
- shift + arrow keys = Select lines of code or symbols real fast
- cmd + shift + Y = Finds references to that code snippet and displays the info in a window below
- alt / option + arrow keys = Move lines of code or the cursor through lines of code
- cmd + return / enter = This starts debugging mode from the Run menu item, no need to go through menu items
- cmd + \ = Toggles breakpoint, no need to go through the Run menu item
- cmd + shift + I = Step Into, no need to go through the Run menu item
- cmd + shift + O = Step Over
- cmd + shift + U = Step Out
Other useful actions, “Attach to Process” and “Detach” when debugging Unity, these don’t have any default keyboard shortcuts, but if you enter MonoDevelop-Unity menu item and reopen Preferences window, you can add your own under “Key Bindings”. This also shows everything I just highlighted and more.
Hope this all helps and please share your workflow improvements!