MonoDevelop Tips: Changing Indentation

It’s easy to increase or decrease indentation of a block of code in MonoDevelop. Hit the Tab key while there is a selection, and the selected lines’ indentation will be increased. Similarly, hit Shift-Tab and the indentation will be decreased.

There is also a command to do this. The indent command can be found in the Edit->Format->Indent Selection menu, with the keybinding Control-Alt-End on Windows and Linux, and Cmd-] on Mac. The unindent command is Edit->Format->Unindent Selection, with the keybinding Control-Alt-Home on Windows and Linux, and Cmd-[ on Mac.

MonoDevelop can also set the indentation to the “correct” value (as determined by the smart indenter) when tab is pressed, like emacs does. This can be enabled with Preferences->Behavior->Interpret tab as reindent command. For some reason, this command isn’t keybindable.