Visual Studio Setup when first viewing a page - visual-studio

Is there a way to setup visual studio 2008 to automatically collapse regions/functions/methods when the code behind is first opened?

In Visual Studio 2010 this seems to auto collapse regions but not methods, classes, etc:
Tools -> Options -> Text Editor -> C# -> Advanced -> Check "Enter Outlining mode when files open".
I use the short-cut Ctrl + M, L to toggle collapsed regions.

Related

Visual Studio comment and uncomment with a single simple keyboard shortcut

I want to know if it is possible to comment and uncomment text blocks in visual studio with a single command. I'm used to just press Ctrl + / to (un)comment text blocks because I've been using Intellij.
But in visual studio you have to press Ctrl + k + c to comment code out and Ctrl + k + u to uncomment.
Is there any way to uncomment / comment your code in visual studio with a single command just like in intellij?
You can actually follow this path Tools -> Options -> Environment -> Keyboard and change the drop-down selection on your top right to Visual Studio Code. This will allow you to use the Visual Studio Code keyboard bindings such as CTRL+/ to comment/uncomment.
Actually yes, there is a way.
Tools -> Options -> Environment -> Keyboard -> Edit.ToggleLineComment
With this you can comment / uncomment a single or even multiple lines with a single shortcut.

How to collapse/expand only regions by keyboard shortcut in Visual Studio 2017?

I've found Quick Launch has CollapseRegions and ExpandRegions which functionality is actually what I need.
But I would like it to be toggled by key in like Ctrl+M,J instead of using Quick Launch like Ctrl+Q > CollapseRegions > Enter.
Is there any way to do that?
In Visual Studio 2017 :
Go to Options -> Text Editor -> C# -> Advance -> activate 'Collapse #regions when collapsing to definitions'
Explicitly to collapse all using Ctrl+M+O and for expand use Ctrl+M+X.

Shortcut for extract local variable in Visual Studio or ReSharper (for C#)

Is there a shortcut for extracting local variable in VS or ReSharper? I know that there are shortcut for extracting field variable but I cannot find for extracting local variable.
Thanks in advance.
Right-clicking a local variable, I get this context menu:
Assuming you want shortcuts for the highlighted commands, you can define your own shortcuts through the Visual Studio keyboard mapper. (Tools -> Options -> Environment -> Keyboard)
Introduce Variable... = "ReSharper.ReSharper_IntroVariable"
Introduce Field... = "ReSharper.ReSharper_IntroduceField"
Introduce Parameter... = "ReSharper.ReSharper_IntroParameter"
FYI My keyboard shortcuts were set by ReSharper via ReSharper -> Options -> Keyboard & Menus and applying the "Visual Studio" scheme.
(Using Visual Studio Community 2015 and ReSharper Ultimate 2015.2)

edit autocomplete settings in visual studio 2010

Where can i change the settings of autocomplete / intelliSense in visual studio 2010?
- Suggestions list shows for every character typed, somewhat annoying.
- Spacebar(and a lot of other characters) is commiting suggestions.
to edit the auto-complete / intellisense settings in visual studio 2010.
go to Tools -> Options... -> TextEditor -> C# -> IntelliSense
Default settings will always show a suggestion list for every character you type, and pressing spacebar (as well as a lot of other stupid characters) will always "commit" the current selected suggestion. Turn that dumb stuff off. Ofcourse you want the Enter key as the "commit" action, to do that just remove all characters and uncheck "Commited by pressing the spacebar".
http://msdn.microsoft.com/en-us/library/vstudio/fcf2zk43(v=vs.100).aspx
Tools -> Options -> Text Editor -> C# -> IntelliSense

Turn off regions in VS2010 C++

I want to turn off regions handling (small + and - signs in the left side, used for regions collapsing) for C/C++ files in Visual Studio 2010.
Tools -> Options -> Text Editor -> C/C++ Formatting -> Enable Outlining -> False
You need to reopen file for this taking effect.

Resources