How to fold while at the closing element?
-
Hello,
when I edit e.g. an XML file in NP++, there are folding marks at the beginning of the structure (squared plus or dash). I can easily fold or unfold the structure by clicking on that mark.
Quite often I find myself wanting to fold (collapse) the structure while I’m at its closing element. How can I quickly do this?
Ideally, I’d have a folding mark at the end of the structure as well.
A second best solution would be to quickly navigate to the matching start element and fold from there.
Is there an easy solution to what I want? Thank you for any hints!
-
@fml2 ,
old (collapse) the structure while I’m at its closing element. How can I quickly do this?
View > Fold Current Level (
Ctrl+Alt+F) (use the shifted version to unfold, or checkmark Settings > Preferences > Editing 1 > ☑ Make current level folding/unfolding commands toggleable to make it a toggle, so the same keystroke folds and unfolds the current level). This will work whether it’s XML or HTML or JSON or anything else with folding.Even though it has “level” in the name, it only does it for the current group, so in
<one> <two> <three/> </two> <anotherTwo> <anotherThree/> </a|notherTwo> </one>if the caret is at the
|in</a|notherTwo>, it will only collapse<anotherTwo>...</anotherTwo>, not anything at level 2.To answer your subquestion, though it’s not as important, there is also a way to:
quickly navigate to the matching start element and fold from there.
@rdipardo’s “HTML Tag” plugin has the Plugins > HTML Tag > Find Matching Tag feature (defaults to
Alt+T), which does that aspect (even in an XML file, even though the plugin has “HTML” in the name). (You can install the plugin through Plugins > Plugins Admin)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login