<?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[Move a block to the right or left]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">Are there shortcuts to Move a block to the right or left completely like microsoft word (ctrl+R and ctrl+L)</p>
<p dir="auto">ctrl+alt+R and ctrl+alt+L  doesn’t work ( the following image)</p>
<p dir="auto"><a href="http://8pic.ir/images/0nu0oph3hj31aer7uidb.jpg" rel="nofollow ugc">http://8pic.ir/images/0nu0oph3hj31aer7uidb.jpg</a></p>
<p dir="auto">I want to move all lines together on the left or right with a shortcut like microsoft word (like the following image)</p>
<p dir="auto"><a href="http://8pic.ir/images/dvprcoax4z2lrrkk98wl.jpg" rel="nofollow ugc">http://8pic.ir/images/dvprcoax4z2lrrkk98wl.jpg</a></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/12598/move-a-block-to-the-right-or-left</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 16:11:44 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12598.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Oct 2016 12:00:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Move a block to the right or left on Wed, 26 Oct 2016 00:04:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a></p>
<p dir="auto">It works</p>
<p dir="auto">Thank you very much</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18809</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18809</guid><dc:creator><![CDATA[Ramin Parsa]]></dc:creator><pubDate>Wed, 26 Oct 2016 00:04:04 GMT</pubDate></item><item><title><![CDATA[Reply to Move a block to the right or left on Tue, 25 Oct 2016 21:04:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <strong>Ramin Parsa</strong>,</p>
<p dir="auto">It look <strong>easy</strong> and <strong>difficult</strong>, at the same time !!</p>
<p dir="auto"><strong>A</strong>) How to move a <strong>block</strong> of lines to the <strong>leftmost</strong> position ( so, at <strong>column 1</strong> )? Quite easy, indeed !</p>
<ul>
<li>
<p dir="auto"><strong>Firstly</strong>, select your <strong>block</strong> of lines</p>
</li>
<li>
<p dir="auto">Open the Replace dialog ( <strong>Ctrl + H</strong> )</p>
</li>
<li>
<p dir="auto">SEARCH <strong><code>^\h+</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>EMPTY</code></strong></p>
</li>
<li>
<p dir="auto">Select the <strong>Regular expression</strong> search mode</p>
</li>
<li>
<p dir="auto">Check the <strong>In selection</strong> option</p>
</li>
<li>
<p dir="auto">Click on the <strong>Replace All</strong> button</p>
</li>
</ul>
<p dir="auto">Et voilà !</p>
<p dir="auto">For instance, from the <strong>original</strong> text, below :</p>
<pre><code>                         This is
                 a
    short and simple test
                      and I
                                   strongly hope that
              everything will turn right, in the
        end !
</code></pre>
<p dir="auto">We’ll get the text below :</p>
<pre><code>This is
a
short and simple test
and I
strongly hope that
everything will turn right, in the
end !
</code></pre>
<p dir="auto">This S/R should be <strong>easily</strong> written, as a macro !</p>
<hr />
<p dir="auto"><strong>B</strong>) How to move a <strong>block</strong> of lines to the <strong>rightmost</strong> position ? This task is <strong>more</strong> difficult and <strong>SHOULD</strong>, normally, be done by a <strong>script</strong> language, as the <strong>Python</strong> or <strong>Lua</strong> plugin</p>
<p dir="auto">Indeed, if we’re going to use regexes, we have to find out, <strong>first</strong>, the number <strong><code>M</code></strong> of characters of the <strong>longest</strong> line of your <strong>block</strong>, as I suppose that the <strong>rightmost</strong> location is located just <strong>after</strong> the <strong>last</strong> character of the <strong>longest</strong> line !</p>
<p dir="auto">In our example above, the <strong>longest</strong> line contains <strong>53</strong> characters =&gt; <strong><code>M = 53</code></strong></p>
<p dir="auto"><strong>Remarks</strong> :</p>
<ul>
<li>
<p dir="auto">I suppose that your text does <strong>NOT</strong> contain any <strong>tabulation</strong> character, only <strong>space</strong> characters !</p>
</li>
<li>
<p dir="auto">To <strong>easily</strong> see the changes, in N++, just display the <strong>EOL</strong> characters ( <strong>View &gt; Show symbol &gt; Show all characters</strong> )</p>
</li>
<li>
<p dir="auto">To run the <strong>three</strong> S/R, below, use, <strong>exclusively</strong>, the <strong>Replace All</strong> button !</p>
</li>
</ul>
<p dir="auto">So, from our <strong>original</strong> text ,below :</p>
<pre><code>                         This is
                 a
    short and simple test
                      and I
                                   strongly hope that
              everything will turn right, in the
        end !
</code></pre>
<p dir="auto">We perform a <strong>first</strong> S/R, which adds <strong>53</strong> spaces, at the <strong>end</strong> of <strong>all</strong> the lines of the <strong>block</strong></p>
<p dir="auto">SEARCH <strong><code>$</code></strong></p>
<p dir="auto">REPLACE <strong><code>53 spaces</code></strong></p>
<p dir="auto">We get the text below :</p>
<pre><code>                         This is                                                     
                 a                                                     
    short and simple test                                                     
                      and I                                                     
                                   strongly hope that                                                     
              everything will turn right, in the                                                     
        end !                                                     
</code></pre>
<p dir="auto">Then, we run a <strong>second</strong> S/R, which <strong>delete</strong> any range of <strong>extra</strong> spaces, beginning at <strong>column 54</strong>, in <strong>all</strong> lines of the <strong>block</strong></p>
<p dir="auto">SEARCH <strong><code>^.{53}\K +</code></strong></p>
<p dir="auto">REPLACE <strong><code>EMPTY</code></strong></p>
<p dir="auto">This time, the text becomes, as below :</p>
<pre><code>                         This is                     
                 a                                   
    short and simple test                            
                      and I                          
                                   strongly hope that
              everything will turn right, in the     
        end !                                        
</code></pre>
<p dir="auto">Finally, use the <strong>third</strong> and last S/R, below, which <strong>swap</strong> the <strong>final</strong> range of <strong>space</strong> characters with the <strong>first</strong> part of <strong>each</strong> line of the <strong>block</strong> :</p>
<p dir="auto">SEARCH  <strong><code>^(.+?)( +)$</code></strong></p>
<p dir="auto">REPLACE <strong><code>\2\1</code></strong></p>
<pre><code>                                              This is
                                                    a
                                short and simple test
                                                and I
                                   strongly hope that
                   everything will turn right, in the
                                                end !
</code></pre>
<hr />
<p dir="auto">No doubt that everyone understands, at once, why a <strong>macro</strong>, with the <strong>three successive</strong> S/R, would <strong>not</strong> adapted to that task :-((</p>
<p dir="auto">Of course, if the <strong>macro</strong> mechanism allow us to enter the <strong>value</strong> of the parameter <strong><code>M</code></strong>, we would just have to determine the <strong>longest</strong> line of the <strong>block</strong> and run the <strong>macro</strong> !</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18805</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18805</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 25 Oct 2016 21:04:26 GMT</pubDate></item></channel></rss>