Format Code In MonoDevelop

user1060500 picture user1060500 · May 5, 2012 · Viewed 26.6k times · Source

I am using MonoDevelop on Mac to write MonoTouch apps. Automatica code indenting/formatting works great while I am typing.

The problem is that when I copy and paste code snippets, in many cases I lose the formatting and lines are combined together, indenting is lost, and it is a huge pain to implement the tabs, spacing, and line breaks manually. Is there anyway I can use a command in monoDevelop to automatically indent and apply the formatting to existing code.

I thought maybe Edit|Format|Format Document/Selection would work, but these commands don't have any affect on the code at all.

Any help?

Answer

Jason Hartley picture Jason Hartley · Apr 4, 2013

To format the entire document in one keystroke: control-I

To format a selection: Edit->Format->Format Selection

To customize the formatting: MonoDevelop->Preferences->Source Code->Code Formatting