A new C++ plugin template
-
Over the years I’ve created more than a few plugins (some available for download…and several that were never finished or made publicly available). Each time I ended up taking an old project, hacking it up, grepping through all the files and renaming everything. This can be quite tedious and error prone.
I’ve created a template for C++ plugins based on my experience doing plugin development. This isn’t just a generic template to modify yourself, this is a cookiecutter template that can dynamically generate a new plugin project for you. To create your own plugin:
- Install Notepad++ v7.7 (or later)
- Install Python (if not installed already)
- From a command prompt, run:
pip install cookiecutter cookiecutter https://github.com/dail8859/cookiecutter-npp-cpp-plugin.git
- You will be asked some basic info (project name, description, etc.) for the new plugin.
- Open the newly created
.sln
file with Visual Studio 2017 - Press
F5
and enjoy.
Visual Studio will build and copy the newly created DLL file into plugin directory of Notepad++. It will also start the Notepad++ application for debugging, meaning you can set breakpoints and step through your plugin source code.
This is still in development and not complete, however it quite usable and will create a project you can instantly run. Hopefully this template can be refined and incorporate other best practices for creating C++ plugins.
-