Where to begin
-
I’m an intermediate level developer and I want to develop a simple plugin for Notepad++ but for all I know the essential functionality may already have been implemented.
In a nutshell, I want to hook into the file|new method and invoke a dialog to select a new file based on a user-created set of templates. So Ineed to be able to crack into the file menu and call a new dialog to load a template that I will have predefined.
To me this seems like reallly basic functionality for any kind of text editor so I’m sure there are already components built that can be retasked to my purposes. Could someone point me in the right direction?
Thanks in advance!
-
So I maybe do something similar. When a new Python file is made by the user, i.e., he saves an empty
.py
file, I have something that detects that and then fills the content of the Notepad++ tab with “boilerplate” code for a Python program. -
I believe you could use the NPPN_FILEOPENED notification and check the filename to see if it’s a new file (it will have no path and just a name like “new 1”). Then run your code to have the user select a template and insert text.
Alternatively, you could just create a menu command for your plugin that lets the user select a template, then create a new file with that template text. Also note that the user can bind shortcut keys to plugin menu items.