<?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[Copy entire line without selecting it?]]></title><description><![CDATA[<p dir="auto">Many IDE’s have this feature that if you don’t select any characters, copying (menu or CTR-C) will copy the entire line the cursor happens to be on, from start to line feed (included). Is there a way  to do that or an extension to enable that in Notepad++?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14920/copy-entire-line-without-selecting-it</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 09:32:54 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14920.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Dec 2017 21:21:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Copy entire line without selecting it? on Sun, 06 Feb 2022 18:40:35 GMT]]></title><description><![CDATA[<p dir="auto">I updated a script method for doing this <a href="https://community.notepad-plus-plus.org/post/73786">HERE</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/73787</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/73787</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sun, 06 Feb 2022 18:40:35 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Wed, 20 Dec 2017 13:51:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a></p>
<p dir="auto">Yes.  Since the PythonScript “copy” case has already been beaten to death in this thread, but the PS “cut” case maybe hasn’t been, here’s the port of your LuaScript for that:</p>
<pre><code>if editor.getSelectionEmpty():
    editor.copyAllowLine()
    editor.lineDelete()
else:
    editor.cut()
</code></pre>
<p dir="auto">A fairly direct port! :-D</p>
<p dir="auto">Unfortunately, in <a href="https://notepad-plus-plus.org/community/topic/14703/run-python-script-pythonscript-plugin-with-a-shortcut" rel="nofollow ugc">PS shortcut-mapping</a> isn’t as easy to do as it is in LS.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28814</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28814</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 20 Dec 2017 13:51:21 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Wed, 20 Dec 2017 13:40:28 GMT]]></title><description><![CDATA[<p dir="auto">I’ve always liked the cutting/copying of entire lines like Visual Studio has (I’m sure many other editors/IDEs have it as well). There are at least 2 plugins available through the PluginManager that adds this functionality to N++. Myself, I’ve been using the following LuaScript for quite a while. I’m sure this logic could be easily adapted to be used in PythonScript as well:</p>
<pre><code class="language-lua">-- Mimic Visual Studio's "Ctrl+C" that copies the entire line if nothing is selected
npp.AddShortcut("Copy Allow Line", "Ctrl+C", function()
    editor:CopyAllowLine()
end)

-- Mimic Visual Studio's "Ctrl+X" that cuts the line if nothing is selected
npp.AddShortcut("Cut Allow Line", "Ctrl+X", function()
    if editor.SelectionEmpty then
        editor:CopyAllowLine()
        editor:LineDelete()
    else
        editor:Cut()
    end
end)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/28813</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28813</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Wed, 20 Dec 2017 13:40:28 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Tue, 19 Dec 2017 23:33:26 GMT]]></title><description><![CDATA[<p dir="auto">With 5 “likes” I guess I didn’t miss the point!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28788</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28788</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Dec 2017 23:33:26 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Sat, 16 Dec 2017 17:31:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mikhail-v" aria-label="Profile: Mikhail-V">@<bdi>Mikhail-V</bdi></a><br />
@ScottSumner</p>
<p dir="auto">Why is the script any more complicated than this one line?<br />
<code>editor.copyAllowLine()</code><br />
Replace the default Control-C mapped command with a pointer to that Pythonscript and that is all it takes.  Unless I’m missing a key point…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28696</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28696</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 16 Dec 2017 17:31:08 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Sat, 16 Dec 2017 14:16:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/v-s-rawat" aria-label="Profile: V-S-Rawat">@<bdi>V-S-Rawat</bdi></a></p>
<p dir="auto">CTRL+SHIFT+L (row 90 - standard configuration)</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28681</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28681</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Sat, 16 Dec 2017 14:16:44 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Sat, 16 Dec 2017 04:44:23 GMT]]></title><description><![CDATA[<p dir="auto">My similar question is "How to Delete entire current line (appearing multiline with word-wrap on) without selecting it first?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28673</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28673</guid><dc:creator><![CDATA[V S Rawat]]></dc:creator><pubDate>Sat, 16 Dec 2017 04:44:23 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Sat, 16 Dec 2017 04:42:46 GMT]]></title><description><![CDATA[<p dir="auto">CTRL+SHIFT+X copies the current line without having to select it.</p>
<p dir="auto">You can find it in shortcut mapper - scintilla commands tab - SCI_LINECOPY</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28672</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28672</guid><dc:creator><![CDATA[V S Rawat]]></dc:creator><pubDate>Sat, 16 Dec 2017 04:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Fri, 15 Dec 2017 18:25:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mikhail-v" aria-label="Profile: Mikhail-V">@<bdi>Mikhail-V</bdi></a></p>
<p dir="auto">Your Pythonscript also requires a separate keycombo for the functionality versus the normal copy function.  Something like the following short script, mapped to ctrl+c (remove the default Scintilla ctrl+c assignment!), might be better as the user gets normal copy-selection capability plus (unselected) current line copy capability…without having to think about what they are doing (just hit ctrl+c!):</p>
<pre><code>if len(editor.getSelText()) &gt; 0:
    editor.copy()
else:
    editor.copyText(editor.getCurLine())
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/28660</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28660</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 15 Dec 2017 18:25:36 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Fri, 15 Dec 2017 18:06:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-frank" aria-label="Profile: Claudia-Frank">@<bdi>Claudia-Frank</bdi></a></p>
<p dir="auto">I think a key point is that people expect this functionality on ctrl+c (or ctrl+x for “cut current line if no selection”)…they don’t want to have to remember a separate key combo for these special cases of copy/cut.  Even when accepting of a separate keycombo, the default of ctrl+shift+x is horrible for the ‘copy’ variant, IMO.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28659</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28659</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 15 Dec 2017 18:06:42 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Fri, 15 Dec 2017 17:50:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/martin-pelletier" aria-label="Profile: Martin-Pelletier">@<bdi>Martin-Pelletier</bdi></a></p>
<p dir="auto">didn’t check when it has been added but the most recent versions do have it and<br />
it is mapped to CTRL+SHIFT+X in default configuration.</p>
<p dir="auto">Check shortcut mapper, scintilla commands - the message you are looking for is<br />
SCI_LINECOPY (row 92 for me).</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28656</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28656</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 15 Dec 2017 17:50:22 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Fri, 15 Dec 2017 02:40:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/martin-pelletier" aria-label="Profile: Martin-Pelletier">@<bdi>Martin-Pelletier</bdi></a><br />
I would also recommend PythonScript plugin.<br />
You’ll just need a two-line script to achieve this:</p>
<p dir="auto"><code>myline = editor.getCurLine()</code><br />
<code>editor.copyText(myline)</code></p>
<p dir="auto">That’s it. The current line (where the caret is) will be<br />
copied into clipboard. Then bind your favourite key to run this and done.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28647</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28647</guid><dc:creator><![CDATA[Mikhail V]]></dc:creator><pubDate>Fri, 15 Dec 2017 02:40:21 GMT</pubDate></item><item><title><![CDATA[Reply to Copy entire line without selecting it? on Fri, 15 Dec 2017 01:56:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/martin-pelletier" aria-label="Profile: Martin-Pelletier">@<bdi>Martin-Pelletier</bdi></a></p>
<p dir="auto">There isn’t a <em><strong>true</strong></em> built-in way, but there are a number of methods for achieving that functionality, some of which are discussed <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/18" rel="nofollow ugc">here</a>.</p>
<p dir="auto">My personal favorite way is via a Pythonscript that flashes the entire line briefly as feedback that the copy actually happened.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/28646</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/28646</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 15 Dec 2017 01:56:49 GMT</pubDate></item></channel></rss>