![]() ![]() ObjSelection.StartOfDocument() ' All done, head back to the start of the docĮDIT: There is now a shortcut called Edit.ToggleOutliningExpansion (Ctrl+M, Ctrl+M) for doing just that. 'objSelection.EndOfDocument() ' Shoot back to the end of the document for ' passes and skip any regions already collapsed.ĭo While (objSelection.FindText("#region", vsFindOptions.vsFindOptionsBackwards))ĭTE.ExecuteCommand("Edit.ToggleOutliningExpansion") ' Collapse this #region FindText would subsequently see the text 'My Class' instead of '#region "My Class"' for the subsequent So when a #region "My Class" is collapsed, ' vsFindOptions.vsFindOptionsMatchInHiddenText is specified. ![]() FindText only sees it's "textual descriptor" unless ' Find the first occurence of #region from the end of the document to the start of the document. Fold All (Ctrl+K Ctrl+0) folds all regions in the editor. ObjSelection.EndOfDocument() ' Shoot to the end of the document Unfold Recursively (Ctrl+K Ctrl+) unfolds the region at the cursor and all regions inside that region. ' Collapses all regions in the current documentĮxpandAllRegions() ' Force the expansion of all regions As Mark pointed out on the answer of Ja圜hase there is an existing shortcut, but it requires the explorer to be in focus. ObjSelection = Nothing ' Release our object Is it possible to collapse only folders and parents, that don't have files opened lilalinux at 7:08 Add a comment 7 Answers Sorted by: 93 I personally prefer not to create new shortcuts. If you alt-click a folder that is opened, it will collapse the entire tree underneath, and upon reopening you will have a nice fresh view of closed folders, etc. ObjSelection.StartOfDocument() ' Shoot us back to the start of the document In sublime, if you alt-click a folder that is closed, it will open all subfolders as well, (expanding the entire tree). 'DTE.ExecuteCommand("Edit.ToggleOutliningExpansion") ' This next command would be what we would normally do *IF* the find operation didn't do it for us. Can you download GitHub No, but if you want to know how to download from GitHub, this step-by-step guide will show you how to download repositories. ' of actually zooming us to the text in question when it is found and ALSO expanding it since itĭo While objSelection.FindText("#region", vsFindOptions.vsFindOptionsMatchInHiddenText) ' Loop through the document finding all instances of #region. ObjSelection.StartOfDocument() ' Shoot to the start of the document ObjSelection = () ' Hook up to the ActiveDocument's selection ' Expands all regions in the current documentĭim objSelection As TextSelection ' Our selection objectĭTE.SuppressUI = True ' Disable UI while we do this ' Macros for improving keyboard support for "#region. I have the following macros which will do just that. The command line interface snap is ready for use: Visual Studio Code. Support CSS Weekly by buying my course: Mastering Prettier & Stylel. I have always wanted Visual Studio to include an option to just collapse / expand the regions. I can open the Dropbox app on my iPhone or iPad and get to all the files in there. A quick tip outlining how to easily collapse all sidebar folders in Visual Studio Code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |