<?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[Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line]]></title><description><![CDATA[<p dir="auto">Is there a way to configure NPP to make the tab key only insert 4 spaces?  Right now, it inserts 4 spaces and then moves the cursor to the first character on the line.  Other editors I’ve used like Textpad work the first way, and I find it more useful.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19283/make-tab-key-just-insert-4-spaces-not-insert-4-spaces-and-move-to-the-first-char-on-the-line</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 16:05:37 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19283.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 Apr 2020 16:48:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Tue, 12 Jul 2022 15:23:32 GMT]]></title><description><![CDATA[<p dir="auto">This did work.  Thank you again.</p>
<p dir="auto">In case anyone else is interested, I added the following to “<strong>C:\Program Files\Notepad++\plugins\PythonScript\scripts\startup.py</strong>”:</p>
<pre><code>def setTabs(arg):
    editor.setTabIndents(False)

notepad.callback(setTabs, [NOTIFICATION.BUFFERACTIVATED])
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/78335</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78335</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Tue, 12 Jul 2022 15:23:32 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Mon, 11 Jul 2022 21:51:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> Thank you!  I’ll give that a shot and report back when I’m done.  I do already have Python Script installed, so hopefully it’ll be fairly straightforward.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78329</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78329</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Mon, 11 Jul 2022 21:51:37 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 08 Jul 2022 14:21:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a> ,</p>
<p dir="auto">Most likely, Notepad++ has started sending that message to scintilla internally (or is sending it more often than it used to).  So you might need to trigger that sendmsg every time a buffer is activated.  I don’t think NppExec can register actions on notifications, though I might misremember.</p>
<p dir="auto">If you are willing to switch to PythonScript or similar, they <em>do</em> have the ability to hook notifications (using <code>notepad.callback(my_callback, [NOTIFICATION.BUFFERACTIVATED])</code>), so once you register that notification during the PythonScript <code>startup.py</code>, then it will trigger that action every time you activate a different tab, so that any tab will always have SCI_SETTABINDENTS at 0.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78231</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78231</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 08 Jul 2022 14:21:10 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 08 Jul 2022 13:54:52 GMT]]></title><description><![CDATA[<p dir="auto">A couple of updates.  It does work as expected when creating and editing new files. So, the script must be running in that case on startup. And it also works on existing files, IF I manually run the script after opening the file.  So the script is still doing the right thing, but something must be “undoing” the setting while opening new files?</p>
<p dir="auto">For now, I’ve added a toolbar button that I’ll use to run the script if I really need this  behavior (e.g. editing code), and dig deeper later.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78228</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78228</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 08 Jul 2022 13:54:52 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Thu, 07 Jul 2022 14:28:20 GMT]]></title><description><![CDATA[<p dir="auto">I need to resurrect this issue, as I realized today that the behavior has returned to what it was before my fix two years ago.  I assume a recent NPP update changed something, and I need to improve my script.  While I dig further, I thought I’d see if anyone knew immediately what needs to be done.</p>
<p dir="auto">To summarize, I created the following script and added it to “Execute this script when Notepad++ starts”:</p>
<pre><code>NPP_CONSOLE 0
SCI_SENDMSG SCI_SETTABINDENTS 0
</code></pre>
<p dir="auto">This gave me the cursor-movement-after-inserting-a-tab behavior I was looking for.  Even though nothing’s changed with my script, or the “Execute…” configuration, the cursor is going to the start of the text today.</p>
<p dir="auto">Any help would be much appreciated.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/78215</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/78215</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Thu, 07 Jul 2022 14:28:20 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Wed, 04 Aug 2021 22:07:02 GMT]]></title><description><![CDATA[<p dir="auto">I hope it’s not too late to say thank you, but I just found your answer to my problem after over a year.  Testing with the Console shows your solutions works perfectly, so I’ll set it up now to execute on startup.  Thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68589</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68589</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Wed, 04 Aug 2021 22:07:02 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 24 Apr 2020 18:24:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a><br />
Sorry, forgot to “@” reference you in my <a href="https://community.notepad-plus-plus.org/topic/19283/make-tab-key-just-insert-4-spaces-not-insert-4-spaces-and-move-to-the-first-char-on-the-line/6">previous reply</a>.  Also note Scintilla has the “opposite” behavior for going backwards.  That is, when you press backspace it can backspace a single space at a time or backspace an entire tab stop.  See the <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_SETTABINDENTS" rel="nofollow ugc">Scintilla Docs</a> for what I mean.  I’ve added <code>SCI_SETBACKSPACEUNINDENTS</code> in my <a href="https://github.com/d0vgan/nppexec" rel="nofollow ugc">NppExec</a> startup.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53053</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53053</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 24 Apr 2020 18:24:40 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 24 Apr 2020 18:14:19 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> said in <a href="/post/53048">Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line</a>:</p>
<blockquote>
<p dir="auto">It could be a setting in Scintilla that I just don’t know about…</p>
</blockquote>
<p dir="auto">Agree the new explanation is much clearer and the setting seems to be:</p>
<p dir="auto">SCI_SETTABINDENTS = 0</p>
<p dir="auto">By default, N++ has it set to 1.  In NppExec, I query it (SCI_GETTABINDENTS ) and it returns 1, but when I set it to 0 and perform the 8 spaces, character at column 9 test described above, I get a tab inserted and my cursor sits at column 4|5.</p>
<pre><code>SCI_SENDMSG SCI_GETTABINDENTS 
================ READY ================
ECHO $(MSG_RESULT)
1
================ READY ================
SCI_SENDMSG SCI_SETTABINDENTS 0
================ READY ================
SCI_SENDMSG SCI_GETTABINDENTS
================ READY ================
ECHO $(MSG_RESULT)
0
</code></pre>
<p dir="auto">Now, assuming the pipe “|” is my cursor:</p>
<pre><code>|        there are 8 spaces before "there"
</code></pre>
<p dir="auto">Press Tab:</p>
<pre><code>    |        there are 8 spaces before "there"
</code></pre>
<p dir="auto">So a scripting plugin (<a href="https://github.com/d0vgan/nppexec" rel="nofollow ugc">NppExec</a>, <a href="http://npppythonscript.sourceforge.net/" rel="nofollow ugc">PythonScript</a>, “<a href="https://metacpan.org/pod/Win32::Mechanize::NotepadPlusPlus::Notepad" rel="nofollow ugc">PerlScript</a>”) could probably do this for you on startup.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53052</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53052</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 24 Apr 2020 18:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 24 Apr 2020 17:50:58 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for confirming.  I just wanted to make sure I wasn’t missing something.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53050</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53050</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 24 Apr 2020 17:50:58 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 24 Apr 2020 17:48:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a></p>
<p dir="auto">That’s a very much better description.<br />
I don’t think there’s a native way to make it do that.<br />
It does the same thing in the Scintilla demo editor.<br />
Scintilla is the editing component that Notepad++ embeds.<br />
It could be a setting in Scintilla that I just don’t know about…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53048</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53048</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 24 Apr 2020 17:48:57 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 24 Apr 2020 17:44:13 GMT]]></title><description><![CDATA[<p dir="auto">Let me see if I can describe in words.</p>
<p dir="auto">1 - Assume I have a line with 8 spaces followed by some text starting at column 9.  The cursor is at the head of the line.</p>
<p dir="auto">2 - In both editors, when I press Tab, four spaces are inserted at the beginning of the line, and the text indents so it’s now starting at column 13.</p>
<p dir="auto">3 - In Textpad, however, the cursor moves to the end of the newly inserted spaces (i.e. the head of column 5), whereas in NPP, the cursor moves to the text (i.e. the head of column 13).</p>
<p dir="auto">I’d like the cursor to continue to stay at the end of the newly inserted spaces, and not jump to the beginning of the text.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53047</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53047</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 24 Apr 2020 17:44:13 GMT</pubDate></item><item><title><![CDATA[Reply to Make tab key just insert 4 spaces, not insert 4 spaces AND move to the first char on the line on Fri, 24 Apr 2020 17:13:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a></p>
<p dir="auto">So for example, your caret is in column 1 on say, an empty line.  You press the Tab key, 4 spaces are inserted and your caret moves beyond the spaces and into column 5.  You would rather have the caret remain in column 1.  Then if you repeatedly press Tab, you’d continue to get groups of 4 spaces inserted, and your caret would still remain in column 1.</p>
<p dir="auto">How about a video of Textpad doing this?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53041</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53041</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 24 Apr 2020 17:13:23 GMT</pubDate></item></channel></rss>