24

In Visual Studio 2012 it's a lot of margins to the left of source code text: Indicator Margin, Selection Margin and Outline Margin. As an old programmer i prefer an uncluttered text, so i want all 3 margins to be hidden from me. In Text editor settings i can hide indicator and selection margins, but i didn't found how to hide an outline margins. Outline graphics (all this "+" things and ines) can be easily hidden from "edit" menu, but margins itself remains. Is it possible to hide it or such feature is not implemented? In previous versions of Visual Studio it auto-hides if "selection margin" was disabled, but now it seems that it don't hide at all :(.

enter image description here

Update

A little clarification why I need it. As correctly mentioned in comments, it's very unusual to have preferences for text formatting and appearance. I agree with that. Unfortunately, in my personal case, I work with text like 10 hours per day for dozens of years and my brain is kind of trained to calculate indentation from text editor left edge. And every time I work in Visual Studio my "wrong indentation" instinct is often triggered by this empty space :). Of course i can re-train myself, but since ALL editors except Visual Studio displays text close to left edge, I will try to configure Visual Studio first.

grigoryvp
  • 40,413
  • 64
  • 174
  • 277
  • 4
    Because i can use Visual Studio VsVim addin. – grigoryvp Dec 12 '13 at 10:29
  • That's probably not to be called margin or empty space. What you called `outline margin` has capability of scoping & collapsing code, what you called `Selection margin` shows changes(saved in green & unsaved in Yellow & undo in orange), what you called `Indicator Margin` shows bookmarks, annotation and breakpoints which are extremely helpful in debugging & intellitrace. It's obvious no other editor provides this much functionality so they don't need that space. – Pranav Singh Dec 20 '13 at 09:43
  • @Pravan I'm really sorry that these names upset you. They are taken from Visual Studio settings windows :(. But if you know how to hide that thing I can call it any name you like :). – grigoryvp Dec 20 '13 at 09:46

6 Answers6

8

Turn off the Indicator margin with Tools + Options, Text Editor, General, untick "Indicator margin"

Turn off the Selection margin with Tools + Options, Text Editor, General, untick "Selection margin"

Turn off the Outline bar with Edit + Outlining, Stop Outlining. That is however liable to come back when you open a new file. You can make it consistent for the C# IDE with Tools + Options, Text Editor, C#, Advanced, untick "Enter outlining mode when files open". If you want to do this for other kinds of files as well then you need to write an add-in that listens for the DocumentEventsClass.DocumentOpened event.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • 2
    As i mentioned in my question, this hides outline graphics (arrows, "+" boxes) but outline margin itself is perfectly visible. – grigoryvp Dec 17 '13 at 09:27
  • You mean you're distracted by a bit of white-space on the left? That's ... unusual. Short from moving the window to the edge of the screen, you can offer suggestions and change requests [at this site](http://visualstudio.uservoice.com/forums/121579-visual-studio). – Hans Passant Dec 17 '13 at 11:56
  • 4
    Not distracted, but through dozens of years I got used to text being displayed close to editor window (ALL editors except Visual Studio do so) and this margin always alerts my "wrong indentation" instincts :(. Of course I can train myself, but if ALL other editors do it one way and VS do it another way i will try to configure the editor first :). Second solution will be to change color of this area - but I also failed with it, seems no such item in editor colors configuration :(. – grigoryvp Dec 17 '13 at 12:33
  • Hmm, sounds to me that you are ready to increase the indent size in your code. Using 4 spaces is boilerplate on those nice big monitors we have these days. Ctrl+E,D is the quicky keystroke to instantly apply it. – Hans Passant Dec 17 '13 at 13:09
  • 1
    Yeah, it's a good solution. But lots of coding standards out there are completely wrong and force poor programmers to use 2 spaces on those nice big 11.6" ultrabook screens :(. Like Ruby (http://goo.gl/vcV1Fp), C++ (http://goo.gl/4Ssu2L) and many other languages :(. Of course I can use hook scripts and code mutators, but I will try to configure IDE first :). – grigoryvp Dec 17 '13 at 14:16
5

I've created an extension for this, it's for VS2015 but if you haven't upgraded yet it should work for VS2012 as well (assuming you're using an edition that supports extensions). The source code is only a few lines and is shown in the screenshot of the posted link.

enter image description here

Malvineous
  • 25,144
  • 16
  • 116
  • 151
Mussi
  • 382
  • 4
  • 4
  • Thank you for this extension, this is something that has been bugging me for a long time. – not an alien Apr 10 '19 at 10:53
  • 3
    Using this for years, since ever. Great extension thanks. Extension name: Hide Suggestion And Outlining Margins. Updated for VS2019 – goamn Apr 23 '21 at 14:35
2

http://blogs.msdn.com/b/saraford/archive/2007/09/13/did-you-know-you-can-hide-outlining-selection-margin-without-turning-off-outlining.aspx

Tools – Options – Text Editor – General, and uncheck Selection Margin...

This work?

lornasw93
  • 182
  • 4
  • 26
  • In old Visual Studio, like "2005" and earlier it hides both selection margin and outline. In 2012 it only hides selection margin (see illustration). – grigoryvp Dec 16 '13 at 09:38
2

Go to VisualStudio->Tools->Options

Drill down to Text Editor->C#->Advanced and uncheck "Enter outlining mode when files open"

Other language editors have similar options to disable outlining mode.

Any files you have open before changing this setting need to be re-opened, or you can turn off outlining from the context menu for each open file. Easier to just close/re-open.

Hope that helps!

Shaun Wilson
  • 8,727
  • 3
  • 50
  • 48
  • 1
    As i mentioned in my question, this hides outline graphics (arrows, "+" boxes) but outline margin itself is perfectly visible :( – grigoryvp Dec 17 '13 at 09:26
1

Here's an extension that worked perfectly for me: https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings

It has custom options to hide/show:

  • the entire margin
  • breakpoint margin
  • line numbers
  • selection margin
Joseph An
  • 822
  • 1
  • 7
  • 19
-1

I can't tell if anyone actually answered your question (which is mine today!). Please see http://www.codeproject.com/Articles/109611/Color-Indicator-for-Code-Changes-Track-Changes-in and particularly the "Enable / Disable" section: "Go to Tools > Options > TextEditor. In General section, you can check or uncheck the 'Track Change' option."

Agree this feature is a big visual hassle during initial development, but it can be helpful during "maintenance" changes.

Corrected per "external link" comment.

softronyx
  • 1
  • 1
  • 1
    You should include the information behind that link in your answer. Otherwise it will become meaningless if the external link changes. – hennes Oct 16 '14 at 10:30