Consult your Visual Studio documentation or the internet if you don’t find what you need here. Note that these may differ slightly depending on which version of Visual Studio you’re using, but they’re generally quite similar between major versions as well. Go to File -> Preferences -> Keyboard Shortcuts (or Ctrl+K Ctrl+S) Search for the word fold all. This can be beneficial to other community members reading this thread. Visual Studio Tips : Expand/Collapse All Expand / Close All Where you see braces or regions in code, you can collapse or expand them with the keyboard shortcut Ctrl + M, P to expand or Ctrl + M, O to collapse. Here are a few helpful Visual Studio keyboard shortcuts to get you started. The default shortcut keys in vs are (collapse) is CTRL + M + CTRL + S and (expand) CTRL + M + CTRL + E, you also can use CTRL + M + CTRL + M to collapse/expand it, please check this: Default keyboard shortcuts. MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not.
If you want to custom the shortcut, please go to tools> options>settings>environment>keyboard, the name of commands areĮdit.ExpandCurrentRegion and set you own shortcuts. If your behavior is not the same, please go to Tools-Import and Export setting…-ResetĪll settings to reset setting to the default one, then check it again. They are key combination, once you press Ctrl+M and you can check the status as below, waiting for second key to trigger this function.
Visual studio hotkeys for expanding code#
+ M to collapse/expand it, please check this:ĭefault keyboard shortcuts. Visual studio code - keyboard shortcuts - expand/collapse all Open the Command Palette ( + + P or F1 on Mac) Search Open Keyboard Shortcuts Then search. This will improve the efficiency in getting things done in code and it is simply. The default shortcut keys in vs are (collapse) is CTRL Use shortcut: Control+shift+Home/End, it is used in both macOS and Windows.