@Leszek-Helak ,
Notepad++ does not natively allow adding new buttons to the Toolbar, without using a plugin.
The Customize Toolbar plugin will allow you to do this.
Use
Plugins > Plugins Admin to install
Customize Toolbar (and restart Notepad++)
Use
Plugins > Customize Toolbar > Custom Button to enable the custom button feature
Edit %AppData%\Notepad++\plugins\Config\CustomizeToolbar.btn to add the following two linesMacro,Trim Trailing Space and Save,,,*S:Tr,*S:Tr
View,Show Symbol,Show All Characters,,*S:¶,*S:¶
The first line is the way to add the macro. Just use your exact macro name instead of Trim Trailing Space and Save.
The second line is to overcome a
bug in the plugin (the plugin isn’t actively maintained, and it started adding extra spaces when Notepad++ improved the behavior of the
[¶] “
Show All Characters” button)
Note: a drawback to this is that it gets rid of Notepad++'s native icon for the action, which also includes a visible pulldown button to indicate there are options on the Toolbar:
8c8abfc4-6bc2-41b4-8763-b5d46818c6ae-image.png
To get the same pulldown when using the CustomizeToolbar, you have to right-click on the new icon:
814c3d29-6130-4e4c-b780-6716775164bc-image.png
If you don’t like the colorful-text-as-icon provided by the Customize Toolbar for the
Show All Characters, then you could follow my instructions in
this reply in the bug report, which gives some example icons and shows you how to use those icons.
Similarly, if you made a .BMP file and two .ICO files for your macro, and put them in the same directory, you could use the similar method for specifying the images for the macro’s icon. An example, based on the instructions in the bug report:Macro,Trim Trailing Space and Save,,,Icons\myMacro.bmp,Icons\myMacro_light.ico,Icons\myMacro_dark.ico
View,Show Symbol,Show All Characters,,Icons\allChars.bmp,Icons\allChars_off.ico,Icons\allChars_off_dark.ico