Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there something like ctrl + m + o for Xaml?

I often miss CTL + M + O, that collapses all properties and methods in the code editor, when working with Xaml.

I installed Xaml Regions and it is nice but I still miss CTL + M + O

I have played around with:

CTL + M + M

CTL + M + L

CTL + M + P

CTL + M + U

But none of them does what I want.

Is there an extension or even a built-in command that does what I want?

To clearify, I want all children of a resource file collapsed to one row for easier navigation like this:

enter image description here

like image 336
Johan Larsson Avatar asked Dec 19 '13 11:12

Johan Larsson


2 Answers

I recently discovered you can use Ctrl+M, L even though it doesn't work directly. It just takes a little algorithm.

  1. Press Ctrl+M, L.
  2. If everything is expanded, press it again.
  3. ???
  4. Profit.

Pressing Ctrl+M, L expands everything if anything is collapsed, otherwise it collapses everything. So when you first open a file, pressing it once should be sufficient. If you've been collapsing and expanding some regions, pressing it once to expand and once to collapse works fine.

like image 50
Kendall Frey Avatar answered Sep 25 '22 09:09

Kendall Frey


This may be too off-topic, however using the VSVim add-on will emulate Vim, unifying a lot of keyboard shortcuts for editing files:

The command zc will close a fold (if the cursor is in an open fold), and zo will open a fold (if the cursor is in a closed fold). It's easier to just use za which will toggle the current fold (close it if it was open, or open it if it was closed).

The commands zc (close), zo (open), and za (toggle) operate on one level of folding, at the cursor. The commands zC, zO and zA are similar, but operate on all folding levels (for example, the cursor line may be in an open fold, which is inside another open fold; typing zC would close all folds at the cursor).

The command zr reduces folding by opening one more level of folds throughout the whole buffer (the cursor position is not relevant). Use zR to open all folds.

The command zm gives more folding by closing one more level of folds throughout the whole buffer. Use zM to close all folds.

Edit: Command sequence in this case would be zM then zo.

like image 28
JeroldHaas Avatar answered Sep 25 '22 09:09

JeroldHaas