Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change default column width / show column ruler in MonoDevelop?

Tags:

c#

monodevelop

I'm trying to change the default column ruler width from 120 to 80. I've come close to it by changing it in Preferences/Source Code/Code Formatting/Text File/Desired file width:; but it warns that "Changes made in this section will only be applied to new projects. Settings for existing projects can be modified in the project (or solution) options dialog".

The problem is, I do not have a Project or Solution; I am just editing some loose scripts I created in a Unity3D project: The whole "Project" menu (which contains both "Project Options" and "Solution Options" submenues)is grayed out, and hence unselectable.

Any way out?

EDIT Upon restart, my setting of 80 characters seems to have been applied... I will still accept any answer that elucidates the preference dynamics...

ADDENDUM This applies to MonoDevelop-Unity version 4.0.1 as shipped with Unity version 4.3.3f1.

like image 998
Nicolas Miari Avatar asked Feb 12 '14 06:02

Nicolas Miari


1 Answers

Changing the displayed column ruler depends on the location of the file you are editing and its type.

Here I assume you are modifying C# files, but if not just choose the adequate file type instead of C# source file like for example: Text file for every file without a recognized type.

If you are editing a file that belongs to a Solution:

  1. Go to Preferences -> Text Editor -> Markers and Rulers, and select the option: Show column ruler.
  2. Now go to Project -> Solution Options -> Source Code -> Code Formatting -> C# source code, and set the column ruler to, say 80, in the textfield Desired file width

If you are editing a file that is not part of a Solution

  1. Go to Preferences -> Text Editor -> Markers and Rulers, and select the option: Show column ruler.
  2. Now go to Preferences -> Source Code -> Code Formatting -> C# source code, and set the column ruler to, say 80, in the textfield Desired file width
  3. Close the file and reopen it for the change to take effect (there is no need in restarting MonoDevelop).

Some extra notes:

  • The second procedure will change the defaults for any future Solution and any future files you open outside of a solution.
  • It doesn't matter if you have a Solution opened or not, if your file does not belong to the solution you need to follow the second procedure, not the first.
like image 170
Daniel Avatar answered Oct 23 '22 17:10

Daniel