<?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 wrap selection by strings on both ends?]]></title><description><![CDATA[<p dir="auto">For document editing, I need to wrap the selected part of the text by special quotes (UNICODE characters that are used in Czech for quoting), like this:</p>
<p dir="auto">„this is the text to be quoted“</p>
<p dir="auto">Having <strong>this is the text to be quoted</strong>, I wan to select it, and to <em>start something named</em> do do the quoting. Say, I wan to name <em>it</em> as <strong>uv</strong>.</p>
<p dir="auto">I remember from some editor (in the past, I do not remember the editor) that it could be done like</p>
<p dir="auto">xxx <strong>#this is the text to be quoted#uv</strong> xxx</p>
<p dir="auto">In other words, the text was marked by # (or something like that), the second one was followed by the name of the <em>macro</em>, and started by some hot-key.</p>
<p dir="auto">Is anything like that possible in the Notepad++ editor?</p>
<p dir="auto">Thanks,<br />
Petr</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26350/how-to-wrap-selection-by-strings-on-both-ends</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 15:02:07 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26350.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 09 Nov 2024 12:43:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to wrap selection by strings on both ends? on Tue, 12 Nov 2024 16:01:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>: Thanks a lot! Being fluent with Python, I have installed the PythonScript, and I am learning first steps.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97833</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97833</guid><dc:creator><![CDATA[pepr]]></dc:creator><pubDate>Tue, 12 Nov 2024 16:01:37 GMT</pubDate></item><item><title><![CDATA[Reply to How to wrap selection by strings on both ends? on Tue, 12 Nov 2024 12:07:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pepr" aria-label="Profile: pepr">@<bdi>pepr</bdi></a> said in <a href="/post/97827">How to wrap selection by strings on both ends?</a>:</p>
<blockquote>
<p dir="auto">Is there any plugin that implements some alternative approach to the macros?</p>
</blockquote>
<p dir="auto">There’s <a href="https://community.notepad-plus-plus.org/topic/23039/faq-how-to-install-and-run-a-script-in-pythonscript">SCRIPTING</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97828</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97828</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 12 Nov 2024 12:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to wrap selection by strings on both ends? on Tue, 12 Nov 2024 09:43:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mkupper" aria-label="Profile: mkupper">@<bdi>mkupper</bdi></a>: Well, the Czech typography uses the double quotes also known as 99 and 66 (because of the shape) — the 99 low, and 66 up. See the image cut from somewhere:</p>
<p dir="auto"><img src="/assets/uploads/files/1731404165025-65daf3e7-2493-4676-a899-a71e42c6e07e-obrazek.png" alt="65daf3e7-2493-4676-a899-a71e42c6e07e-obrazek.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Thanks for the hint for using the regular expression with # as marks. I was not thinking about that possibility.</p>
<p dir="auto">@anyone: The macro recording and playback in Notepad++ is fine for simple things, in my opinion. However, it is difficult to modify the macros (through editing shortcuts.xml). Is there any plugin that implements some alternative approach to the macros?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97827</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97827</guid><dc:creator><![CDATA[pepr]]></dc:creator><pubDate>Tue, 12 Nov 2024 09:43:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to wrap selection by strings on both ends? on Tue, 12 Nov 2024 01:28:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pepr" aria-label="Profile: pepr">@<bdi>pepr</bdi></a>, one minor comment on</p>
<blockquote>
<p dir="auto">„this is the text to be quoted“</p>
</blockquote>
<p dir="auto">I see that for the opening quote you used U+201E DOUBLE LOW-9 QUOTATION MARK. I expected you to use U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK for the closing quote. Instead you used U+201C LEFT DOUBLE QUOTATION MARK.</p>
<p dir="auto">The difference is</p>
<ul>
<li>„this is the text to be quoted‟ using U+201F</li>
<li>„this is the text to be quoted“ using U+201C</li>
</ul>
<p dir="auto">If you intended to use U+201F then the line in your shortcuts.xml would look like</p>
<pre><code>&lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="„${0}‟" /&gt;
</code></pre>
<p dir="auto">The second part that you desire likely could be done in Notepad++.  <a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a> already provided you with a hint on how to do it by showing you a search replace that takes the current selection and inserts a <code>„</code> in front of it and appends a <code>‟</code> at the end of it.</p>
<p dir="auto">If instead you want to type</p>
<pre><code class="language-txt">xxx #this is the text to be quoted#uv xxx
</code></pre>
<p dir="auto">You then run this regular expression search/replace:<br />
** Search: <code>#([^#]+)#uv</code><br />
Replace: <code>„${1}‟</code> **</p>
<p dir="auto">That will replace the <code>#...#uv</code> style marks in your text with <code>„...‟</code>.</p>
<p dir="auto">If you want to be able to use several styles of quotes using <code>#xx</code> or other things besides <code>#uv</code> then it’s still possible though gets far messier do to it with a single search/replace.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97823</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97823</guid><dc:creator><![CDATA[mkupper]]></dc:creator><pubDate>Tue, 12 Nov 2024 01:28:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to wrap selection by strings on both ends? on Sun, 10 Nov 2024 17:19:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mark-olson" aria-label="Profile: Mark-Olson">@<bdi>Mark-Olson</bdi></a>: Thanks. The first part works exactly as I wanted. Looking at the shortcuts.xml, I can see:</p>
<pre><code>        &lt;Macro name="uv" Ctrl="no" Alt="no" Shift="no" Key="0"&gt;
            &lt;Action type="3" message="1700" wParam="0" lParam="0" sParam="" /&gt;
            &lt;Action type="3" message="1601" wParam="0" lParam="0" sParam="(?s).*" /&gt;
            &lt;Action type="3" message="1625" wParam="0" lParam="2" sParam="" /&gt;
            &lt;Action type="3" message="1602" wParam="0" lParam="0" sParam="„${0}“" /&gt;
            &lt;Action type="3" message="1702" wParam="0" lParam="896" sParam="" /&gt;
            &lt;Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /&gt;
        &lt;/Macro&gt;
</code></pre>
<p dir="auto">For explaining the second part. The other mentioned editor used the #quoting by hashes#macro_name to ge the same effect. Some shortcut was used to tell that the thing before is the macro name, and the special character is the delimiter (instead of making a selection). It may have been the JED editor that simulates Emacs (using a different inner language). The macros were easily edited, and you could use even more delimiters to wrap the parts, say, by more complex LaTeX macros with more arguments. I am not using it more than 20 years; so, I am not sure whether JED was the one.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97796</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97796</guid><dc:creator><![CDATA[pepr]]></dc:creator><pubDate>Sun, 10 Nov 2024 17:19:12 GMT</pubDate></item><item><title><![CDATA[Reply to How to wrap selection by strings on both ends? on Sat, 09 Nov 2024 17:16:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pepr" aria-label="Profile: pepr">@<bdi>pepr</bdi></a></p>
<p dir="auto">I am having a hard time understanding what you are asking for. If you are not a native English speaker, I would recommend writing what you want in your native language, and copy-pasting it into Google Translate rather than trying to do the translation yourself. It sounds like there are two things you want:</p>
<ol>
<li>Wrap the selected text in quotes</li>
<li>Add a <code>#</code> and then a name to the end of the selected text</li>
</ol>
<p dir="auto"><strong>How to wrap the selected text in quotes</strong></p>
<p dir="auto">Important: while doing steps 2-4, <strong>do not click in the text area of the Notepad++ window!</strong> If you do, your selection will change and that will become part of the macro.</p>
<ol>
<li>Go to <code>Macro-&gt;Start Recording</code> from the Notepad++ main menu bar</li>
<li>Go to <code>Search-&gt;Replace...</code> from the main menu; the find/replace form will pop up.</li>
<li>Set the fields of the find/replace form as follows:
<ul>
<li><code>Find what:</code> -&gt; <code>(?s).*</code></li>
<li><code>Replace with:</code> -&gt; <code>„${0}“</code></li>
<li><code>Wrap around</code> -&gt; <strong>checked</strong></li>
<li><code>Search Mode</code> -&gt; <code>Regular expression</code></li>
<li><code>In selection</code> -&gt; <strong>checked</strong></li>
</ul>
</li>
<li>Hit the <code>Replace</code> button</li>
<li>Go to <code>Macro-&gt;Stop Recording</code> from the Notepad++ main menu</li>
<li>Try selecting a different area of text and run <code>Macro-&gt;Playback</code> from the Notepad++ main menu, and make sure that the macro does what you want</li>
<li>Go to <code>Macro-&gt;Save Current Recorded Macro</code> from the NPP main menu and save your macro with a name. You can also give this macro a keyboard shortcut for ease of use later.</li>
</ol>
<p dir="auto"><strong>How to add <code>#uv</code> at the end of your selected text</strong></p>
<ol>
<li>Repeat steps 1-2 of the list above</li>
<li>Set the fields of the find/replace form as follows:
<ul>
<li><code>Find what:</code> -&gt; <code>(?s).*</code></li>
<li><code>Replace with:</code> -&gt; <code>${0}#uv</code></li>
<li><code>Wrap around</code> -&gt; <strong>checked</strong></li>
<li><code>Search Mode</code> -&gt; <code>Regular expression</code></li>
<li><code>In selection</code> -&gt; <strong>checked</strong></li>
</ul>
</li>
<li>Repeat steps 4-7 of the list above</li>
</ol>
<p dir="auto"><strong>Other notes</strong></p>
<p dir="auto">For more reading on macros, <a href="https://npp-user-manual.org/docs/macros/" rel="nofollow ugc">see the documentation here</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97772</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97772</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Sat, 09 Nov 2024 17:16:48 GMT</pubDate></item></channel></rss>