Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What I do in Notepad++ is:</p> <ul> <li>There's a "trim trailing spaces" macro in TexFX > TexFX Edit.</li> <li>Use this to build a "trim and save" macro.</li> <li>Bind that macro to <kbd>CTRL</kbd>+<kbd>S</kbd>, and bind 'Save' to something else.</li> </ul> <p>I'd tell you how to record a macro that uses another macro, but it's years ago I did it and now I just copy the file around. I expect it Just Works, or possibly I did it by manually editing the shortcuts file. It looks like this (in shortcuts.xml):</p> <pre><code>&lt;Macro name="Trim and save" Ctrl="no" Alt="yes" Shift="yes" Key="83"&gt; &lt;Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /&gt; &lt;Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /&gt; &lt;Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /&gt; &lt;Action type="0" message="2327" wParam="0" lParam="0" sParam="" /&gt; &lt;Action type="0" message="2327" wParam="0" lParam="0" sParam="" /&gt; &lt;Action type="2" message="0" wParam="42024" lParam="0" sParam="" /&gt; &lt;Action type="2" message="0" wParam="41006" lParam="0" sParam="" /&gt; &lt;/Macro&gt; </code></pre> <p>Two warnings:</p> <ul> <li><p>The trim macro is buggy. It only works if the cursor is at the end of a line when it's used. I occasionally think about trying to fix it or do my own, but can never be bothered because I reflexively work around it by moving the cursor myself before saving. The same workaround could just be built into your "trim and save" macro.</p></li> <li><p>Some people get upset if you strip trailing whitespace out of "their" files - either because they like it, or because they sometimes use diff without ignoring whitespace (for instance in change reports) and don't want to see that you've changed half the file when really it was a one-liner. So for those files, just leave the trailing whitespace as it is and save with alt-f-s (or the 'something else' you moved save to) instead of ctrl-s. You probably need to set Notepad++ not to clear the undo buffer on save: otherwise a mistake here would be a bit of a disaster. But I set that anyway.</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload