8

I am looking for a way to create custom buttons for Notepad++. So far I haven't been able to find solutions regarding this.

The buttons would be doing a regular expression search and highlight the search results as well. This would make it much easier for me to analyze error logs. This would eliminate the need of copy/pasting the long regex search queries.

I'm trying to use the Customize Toolbar plugin to accomplish this, but I couldn't find a thorough documentation of it and therefore having troubles.

Any help would be appreciated.

Toto
  • 89,455
  • 62
  • 89
  • 125
Endy
  • 83
  • 1
  • 3

1 Answers1

9

There you go:

  1. Download "Customize Toolbar" from the "Plugin Manager"

  2. Go to menu "Plugins" > "Customize Toolbar" and select "Custom Buttons"

  3. Restart Notepad++

  4. Now it's the important part, where you need to create the button's functionality. In your case you want to simply search and fortunately this can be implemented in a Macro. If you need something more complex that can't be recorded in a Macro, consider the use of "Python Script" plugin (which is really easy even with a minimal knowledge of Python) or writing your own plugin (which I guess is more difficult, I never tried to). So, let us assume that you recorded a Macro and you named it "test".

  5. Find and open the file %APPDATA%\Notepad++\plugins\config\CustomizeToolbar.btn

  6. Add the following new row in the file:

    Macro,test,,,

That's all. You now have a new button in your toolbar that runs your macro.

Community
  • 1
  • 1
psxls
  • 6,807
  • 6
  • 30
  • 50
  • Hi, I came across as I've similar problem but I don't seem to be able to find the `CustomizeToolbar.btn` file instead there is a binary file with the same name but `.dat` extension. On the same lines, if my macro is named `Run those lines in ` shall I add the name in inverted commas? – Konrad Jun 08 '15 at 09:34
  • 1
    @Konrad, I am sorry that I cannot help, since I am not using this software anymore. But I remember that there was a .btn and a .dat file with the same name, on this folder. So, I would suggest to check if you do have the latest Notepad++ and reinstall the Customize Toolbar plugin. – psxls Jun 08 '15 at 10:33
  • @Konrad if you are still wondering where the original file "CustomizeToolbar.btn" appears, it shows when you click "Plugins > Customize Toolbar > Custom Buttons". – Mike Mar 27 '16 at 14:58
  • update: pythonscript was awesome but it only support python 2.7.6 (and won't be updated). – JinSnow Jan 06 '17 at 19:54
  • After update of NPP I had a little problem (using German UI): the menu was no longer called "Makro" but "Makros". This need to be fixed in customizeToolbar.btn - then everything fine again – Volker Feb 02 '22 at 19:58