Visual Studio For Mac Code Collapse

Active5 months ago

In Visual Studio (2008) is there a command to collapse/expand all the sections of code in a file?

Uwe Keim
28.2k33 gold badges142 silver badges227 bronze badges
Mr. Flibble

Reported by joachim.schumacher Oct 04 at 10:53 AM visual studio 2017 version 15.8 windows 10.0 editor. I have several classes and properties that require attributes. When I collapse the property code, the editor shows just one line, starting with the attributes and putting the. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications. Download Visual Studio Code - Mac, Linux, Windows This site uses cookies for analytics, personalized content and ads.

Mr. Flibble
12.2k19 gold badges63 silver badges96 bronze badges

19 Answers

CTRL + M + O will collapse all.

Visual Studio For Mac

CTRL + M + L will expand all. (in VS 2013 - Toggle All outlining)

CTRL + M + P will expand all and disable outlining.

CTRL + M + M will collapse/expand the current section.

Code

CTRL + M + A will collapse all even in Html files.

These options are also in the context menu under Outlining.

Right click in editor -> Outlining to find all options.(After disabling outlining, use same steps to enable outlining.)

Super Jade
8642 gold badges11 silver badges23 bronze badges
BobBob
71k27 gold badges108 silver badges122 bronze badges

The following key combinations are used to do things:

CTRL + M + M →Collapse / Expand current preset area (e.g. Method)

CTRL + M + H → Collapse / Hide (Expand) current selection

CTRL + M + O → Collapse all(Collapse declaration bodies)

CTRL + M + A → Collapse all

CTRL + M + X → Expand all

CTRL + M + L → Toggle all

There some options in the context menu under Outlining.

Peter Ivan
1,1632 gold badges12 silver badges24 bronze badges
Bhavesh KachhadiyaBhavesh Kachhadiya
3,2953 gold badges10 silver badges19 bronze badges

CTL + M + L expands all

CTL + M + O collapses all

In the MSDN article 'Default Keyboard Shortcuts in Visual Studio,' see the section 'Text Editor' if you're looking for other shortcuts - these 2 are just a few of the many that are available.

DavidRR
10.3k11 gold badges67 silver badges142 bronze badges
Scott IveyScott Ivey
33.3k17 gold badges73 silver badges115 bronze badges
M4NM4N
77k40 gold badges194 silver badges250 bronze badges
  • Fold/Unfold the current code block – Ctrl+M, Ctrl+M
  • Unfold all – Ctrl+M, Ctrl+L
  • Stop outlining – Ctrl+M, Ctrl+P
  • Fold all – Ctrl+M, Ctrl+O
user212218
AvatarOfChronosAvatarOfChronos

In Visual Studio 2017, It seems that this behavior is turned off by default. It can be enabled under Tools > Options > Text Editors > C# > Advanced > Outlining > 'Collapse #regions when collapsing to definitions'

GelásioGelásio

CTL + M + A collapses all

works for me, whereas

CTL + M + O

does not

RayRay

Are you refering to the toggle outlining?

You can do:Control + M then Control + L to toggle all outlining

lime
5,4543 gold badges33 silver badges46 bronze badges
CodeLikeBeakerCodeLikeBeaker
14k12 gold badges62 silver badges93 bronze badges

In Visual Studio 2013:

CTL + M + A collapses all

CTL + M + L expands all

Nathan ChaseNathan Chase
1,4111 gold badge15 silver badges15 bronze badges

Below are all what you want:

  • Collapse / Expand current Method

CTRL + M + M

  • Collapse / Expand current selection

CTRL + M + H

  • Collapse all

CTRL + M + O

CTRL + M + A

  • Expand all

CTRL + M + X

CTRL + M + L

student
13.1k10 gold badges84 silver badges142 bronze badges
HarishhHarishh

If you mean shortcut then

CTRL + M + M: This one will collapse the region your cursor is at whether its a method, namespace or whatever for collapsing code blocks, regions and methods. The first will collapse only the block/method or region your cursor is at while the second will collapse the entire region you are at.

series0ne
17.9k28 gold badges112 silver badges206 bronze badges
ShobanShoban
21.1k8 gold badges57 silver badges105 bronze badges

Press

CTL + A

Then

CTL + M + M

To compress all, including child nodes, in XML-files.

CarlCarl

To collapse all use:

Ctrl + M and Ctrl+A

All shortcuts for VS 2012/2013/2015 available at http://visualstudioshortcuts.com/2013/

studentVisual Studio For Mac Code Collapse
13.1k10 gold badges84 silver badges142 bronze badges
AhmadAhmad

In case of ugrading to Visual Studio 2010, 2012, 2013 or 2015, there's a Visual Studio extension to show current registered keyboard shortcuts, IntelliCommand.

Abdulhameed ShalabiAbdulhameed Shalabi

if you want to collapse and expand particular loop, if else then install following plugins for visual studio.

Juned AnsariJuned Ansari
2,5422 gold badges22 silver badges46 bronze badges

None of these worked for me. What I found was, in the editor, search the Keyboard Shortcuts file for editor.foldRecursively. That will give you the latest binding. In my case it was CMD + K, CMD + [.

mclhrnmclhrn

Collapse All - Ctrl + M + O

Expand All - Ctrl + M + L

vikas Chaturvedivikas Chaturvedi

Visual Studio can help you find the answer to your question in a couple of different ways.

Type Ctrl + Q to access Quick Launch, and then enter 'collap'. Quick Launch will display something like:

From there, enter 'outlining' to find other menu entries related to outlining:

However, note that Quick Launch will show you only those commands that are available as Visual Studio menu entries. To find other keyboard-related commands related to collapsing sections of code, in the Visual Studio menu bar click:

This will display the keyboard section in the Options dialog box. In the 'Show commands containing' text box, enter 'edit.collap'. Visual Studio will display a list that is something like:

You'll need to click each command to see its associated keyboard shortcut.

My examples taken from Visual Studio 2013.

DavidRRDavidRR
10.3k11 gold badges67 silver badges142 bronze badges

If you want to collapse/expand an area within a class/method (instead of collapsing the entire class/method), you may create custom regions as follow:

Rajkumar SRajkumar S

Not the answer you're looking for? Browse other questions tagged visual-studio-2008visual-studio or ask your own question.

Visual Studio For Mac Code Collapse
Active10 months ago

I just downloaded a VSIX file from the Visual Studio Gallery.

How do I install it in Visual Studio?

slhck
171k49 gold badges476 silver badges492 bronze badges
KdgDevKdgDev
2,46316 gold badges44 silver badges66 bronze badges

8 Answers

VSIX is a Visual Studio extension installer. You must have Visual Studio 2010 or newer in order to install them, but you should be able to install it by double-clicking the .vsix file. Alternatively you should be able to install it from within the VS Extension Manager (Tools->Extension Manger)

See more about VSIX files at Quan To's Visual Studio Extensibility blog

heavydheavyd
52.6k13 gold badges126 silver badges158 bronze badges

The above answers didn't help me; I couldn't install it through the extension manager and there was not default application for .vsix. However, I needed to open it (right click >Open with...) with Microsoft Visual Studio Version Selector and it worked.

Small update:For VS 2013, you need the corresponding version of NuGet: http://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca.Otherwise, the version selecter will tell you it's already installed on all fitting versions.

Cedric ReichenbachCedric Reichenbach

To summarise, there are three options:

  1. Install via Extension Manager (Tools/Options)
  2. Install via Visual Studio Gallery.com (download and open directly or save then double-click)
  3. Install via 'xcopy' into %localappdata%MicrosoftVisualStudio10.0Extensions
jnm2
1791 gold badge4 silver badges19 bronze badges
BenjolBenjol
1,2281 gold badge19 silver badges35 bronze badges

If all the above options fail, try installing it from the command-line.Here's how (on StackOverflow):

VSIXInstaller.exe /quiet some_extension.vsix

You can find VSIXInstaller here (on your local PC - depending on the Visual Studio version replace 14.0 by the version you're using):

C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDE

To display the installer dialog(s), remove the /quiet option.

Note:

  • To uninstall a VSIX extension, you need to know its vsixID (here is described how to get it), then you can use

    VSIXInstaller.exe /uninstall:vsixID

  • To install/uninstall VSIX files for a specific Visual Studio version, use the switches /skuName:name and /skuVersion:version; you can see all options of the command line tool if you type VSIXInstaller.exe /? in the developer command prompt.

MattMatt

Visual Studio For Mac Os

Did you know that the VSIX is nothing more than a ZIP file. After double clicking on it, the VS selector prompts you for each installed version of Visual Studio to install it too. This is where vs picks an arbitrary folder name and unpacks the content to the %AppData%LocalMicrosoftVisualStudio##Extensions folder. So Benjol was partially correct save for unpacking the files from the VXIS(again which is a Zip).

Rashad RiveraRashad Rivera

VSIXInstallerinC:Program Files (x86)Microsoft Visual StudioInstallerresourcesappServiceHubServicesMicrosoft.VisualStudio.Setup.Service

tangtang

I think you just reload Visual Studio after downloading the VSIX. During the launch Visual Studio looks for the VSIX file and incorporatesall the required changes.

bla-bla

Here are the instructions for Visual Studio Code.1 step

second step

Balaban MarioBalaban Mario

Visual Studio Collapse Methods

Not the answer you're looking for? Browse other questions tagged windowsvisual-studio-2010visual-studio or ask your own question.