Make the code folding icons always show in Visual

2020-02-07 02:30发布

问题:

Loving using Visual Studio but one peeve is that I always think my code isn't indented properly since the left edge of the actual editor is kind of far from the numbers.

Is there any way to show the code folding +/- icons by default? It only shows them if you hover over the gutter.

As an aside, if there is a way to change the color of the gutter so it looks distinct from the editor?

回答1:

To change the color of the gutter, you can add following to the user settings:

"workbench.colorCustomizations": {
    "editorGutter.background": "#abcdef"
}

And to show folding icons:

"editor.showFoldingControls": "always"

Note that this setting requires you to have at least 1.13.



回答2:

You cannot make code folding icons appear persistently. It is discussed here on project github page however it is not implemented yet.

If you want proper indentation your best bet is indentation guides (the vertical lines that run down to matching indents).

Indentation guides are not displayed by default.
To enable indent guides go to File --> Preferences --> Settings and then place following line in settings.json file,

"editor.renderIndentGuides": true