<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to fold while at the closing element?]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">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.</p>
<p dir="auto">Quite often I find myself wanting to fold (collapse) the structure while I’m at its <em>closing</em> element. How can I quickly do this?</p>
<p dir="auto">Ideally, I’d have a folding mark at the end of the structure as well.</p>
<p dir="auto">A second best solution would be to quickly navigate to the matching start element and fold from there.</p>
<p dir="auto">Is there an easy solution to what I want? Thank you for any hints!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27700/how-to-fold-while-at-the-closing-element</link><generator>RSS for Node</generator><lastBuildDate>Tue, 03 Nov 2026 00:32:19 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27700.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Nov 2026 22:32:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to fold while at the closing element? on Mon, 02 Nov 2026 23:16:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fml2" aria-label="Profile: fml2">@<bdi>fml2</bdi></a> ,</p>
<blockquote>
<p dir="auto">old (collapse) the structure while I’m at its closing element. How can I quickly do this?</p>
</blockquote>
<p dir="auto"><strong>View &gt; Fold Current Level (<code>Ctrl+Alt+F</code>)</strong> (use the shifted version to unfold, or checkmark <strong><a href="https://npp-user-manual.org/docs/preferences/#editing-1" rel="nofollow ugc">Settings &gt; Preferences &gt; Editing 1</a> &gt; ☑ Make current level folding/unfolding commands toggleable</strong> 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.</p>
<p dir="auto">Even though it has “level” in the name, it only does it for the current group, so in</p>
<pre><code>&lt;one&gt;
  &lt;two&gt;
    &lt;three/&gt;
  &lt;/two&gt;
  &lt;anotherTwo&gt;
    &lt;anotherThree/&gt;
  &lt;/a|notherTwo&gt;
&lt;/one&gt;
</code></pre>
<p dir="auto">if the caret is at the <code>|</code> in <code>&lt;/a|notherTwo&gt;</code>, it will only collapse <code>&lt;anotherTwo&gt;...&lt;/anotherTwo&gt;</code>, not <em>anything</em> at level 2.</p>
<p dir="auto">To answer your subquestion, though it’s not as important, there is also a way to:</p>
<blockquote>
<p dir="auto">quickly navigate to the matching start element and fold from there.</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a>’s “HTML Tag” plugin has the <strong>Plugins &gt; HTML Tag &gt; Find Matching Tag</strong> feature (defaults to <code>Alt+T</code>), which does that aspect (even in an XML file, even though the plugin has “HTML” in the name).  (You can install the plugin through <strong>Plugins &gt; Plugins Admin</strong>)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106677</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106677</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 02 Nov 2026 23:16:09 GMT</pubDate></item></channel></rss>