What is this? Its a simple template for very fast and easy building plugins for Notepad++ in C#/.Net
This is a fork of UFO's plugin package updated for VS2015
- Download a release
- Place the visual studio project template (the
NppPlugin.zip) in the visual studio path (typically"My Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#\") - Ensure you have installed Visual C++ from the visual studio installer otherwise your project wont build

- Create a new project inside Visual studio using
file -> new -> project -> visual C# -> Notepad++ project - Build (building will copy the dll to the
Notepad++/pluginsfolder) - Start Notepad++ and activate your plugin from the plugins menu
-
Upgrading the pluging package
- replacing the
NppPluginXXXX.zipfrom your visual studio (typically"My Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#\") with a newer version
- replacing the
-
Upgrading plugings using the plugin pack.
- Delete the folder
PluginInfrastructureand copy over that folder from a newer version ofNppPluginXXXX.zip - Open visual studio
- Click "show all files" in the "solution explorer"
- Select the new files, Right-click and choose "include in project"
- Delete the folder
- https://github.com/kbilsted/NppPluginGuidHelper
- https://github.com/zkirkland/FirstUpper
- https://github.com/kbilsted/NppPluginCutNCopyLine
- https://github.com/kbilsted/NppPluginRebaseAssister
First read the the demo-plugin code. It is actively being maintaned - see https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/tree/master/Demo%20Plugin it is a spin-off of Don Ho's http://download.tuxfamily.org/nppplugins/NppPluginDemo/NppPluginDemo.zip
Plugins can interact with Notepad++ or the underlying Scintilla engine. The plugin pack provides two classes to make this interaction easier. This is NotepadPlusPlusGateway and ScintillaGateWay which are thin layers making interaction more pleasant (and testable!).
If you are interested in low-level access you can use the Win32 api also included in the plugin pack.
The architecture of the plugin is.
+-----------+ +-----------+
| Scintilla | | Notepad++ |
+-----------+ +-----------+
^ ^
| |
+--------+--------+----+------------+
| | |
+------------------+ +----------------+ +-----------+
| ScintillaGateway | | NotepadGateway | | Win32 |
+------------------+ +----------------+ +-----------+
^ ^ ^
| | |
+-----------------+---+----------------+
|
+-----------+
| Plugin |
+-----------+
- start notepad++
- in Visualstudio: debug -> attach to process... -> notepad++.exe
you can now set breakpoints and step-execute. (currently not working in v6.9.2 notepad-plus-plus/notepad-plus-plus#1964)
- you can make this process easier by setting the "start action" in the project -> properties -> debug to start notepad++.exe - then you can simply build and hit
F5.
Until we reach v1.0 expect a bit of chaos and breaking changes.
From v1.0 and onwards we will turn over to semantic versioning
- For the main work on the plugin package
- A Guy called "Ufo" - merging in v0.5 http://sourceforge.net/projects/sourcecookifier/files/other%20plugins/NppPlugin.NET.v0.5.zip/download and v0.7 https://bitbucket.org/uph0/npppluginnet
- The DllExport technique:
- works with .NET Runtime 3.5 and above (can easily be reduced to .Net runtime 2.0 if needed)
- UNICODE plugins only.
I blog at http://firstclassthoughts.co.uk/ on code readability and quality