- Home /
Set Default MonoDevelop Formatting Options
A frustrating aspect of working with MonoDevelop is the way it can auto-format your code in ways that you don't want it to. When the auto-format works correctly, it is great. Otherwise, it feels like a constant struggle.
I've found that changing MonoDevelop's default policy formatting and tab width settings don't affect the solution generated by Unity. Additionally, while you can change the formatting and tab width settings for the solution after Unity generates it, Unity has a tendency to overwrite your solution and any custom settings regularly. This is particularly annoying to me because the default settings seem a bit wonky (an indent width of 8, really?).
Is there any way I can set Unity's default policy to different values? For code file templates, Unity has the templates available in the install directory, and you can overwrite them to create custom C# or JS templates, which I've found very useful. Are there any similar files for creating custom MonoDevelop solution settings? And if not, how are other people solving this issue when the default MonoDevelop formatting settings don't match the formatting settings you would like to use?
I should mention that this is using the "new" MonoDevelop (4.0.1), but I think it applies to the old one as well.
Answer by sonicviz · Dec 01, 2013 at 09:26 AM
Actually I got back my old settings by doing the following: Project/Solution Options/Source Code/C# Source Code Set Policy to Microsoft Visual Studio and uncheck the use default settings from text file.
Setting general options Code formatting only applies to new projects so you have to change it under project solution options
Cool, that seems to have the desired effect so far! I tried re-syncing the project a couple times and adding new code files. So far, the formatting settings are staying how I want them. Thanks!
Answer by sonicviz · Dec 01, 2013 at 09:26 AM
I've found the same issue. No solution as yet. Pita.
You will need to go to specific project settings, and later on, for each existent file hit CTRL+A then CTRL+I and finally CTRL+S if you want to apply for each file.
Answer by FedericoCara · May 14, 2018 at 03:20 PM
How can I make Visual Studio to format code like Monodevelop (which is more compact)?
Your answer
Follow this Question
Related Questions
monodevelop formatting policy to allow single-line 'if' statemetns? 2 Answers
Precompiler directives break MonoDevelop autoformat 0 Answers
MonoDevelop 4.0.1 auto (de)formatting 0 Answers
Indentation formatting issue in MonoDevelop-Unity 4.0.1 (Win7) 3 Answers
Stop Monodvelop adding new line when using attribute 1 Answer