This is a template for Notepad++ plugins written in C#. The vast majority of the code (certainly all the parts that were really hard to implement) come from kbilsted's now-archived NotepadPlusPlusPluginPack.Net
, with some significant changes, including:
- A simpler architecture in which the PluginInfrastructure folder is side-by-side with the rest of the plugin's code, rather than in a separate directory tree.
- An example of a non-docking (pop-up) dialog opened from the plugin menu, a docking form, and a non-docking non-pop-up form.
- A settings form that makes it easy for the maintainer to add, remove or edit settings.
- A template for automated tests that can be run inside Notepad++, including a template for user interface tests that automatically test forms.
If you have any issues, see if updating to the latest release helps, and then feel free to raise an issue on GitHub. Please be sure to include diagnostic information about your system, Notepad++ version, and plugin version (go to ?->Debug Info...
from the Notepad++ main menu).
Read information about the plugin architecture (some of this may be out of date)
- Download the source code in one of the following ways:
- clone the repository
- download the source code for the repo, then create a git repo inside
- fork this repo
- download the source code for a release (see the Releases page)
- Open NppCSharpPluginPack/NppCSharpPluginPack.sln in Visual Studio 2022
- Configure the security settings of
%ProgramFiles%/Notepad++/plugins
so that Visual Studio can write to%ProgramFiles%/Notepad++/plugins/CSharpPluginPack
. I do this in the following way:- Open
%ProgramFiles%/Notepad++
in the File Explorer. - Right-click on the
plugins
folder. - Choose
Properties
from the drop-down menu - Select the
Security
tab. - Click the
Edit...
checkbox - Select
Users
from theGroup or user names
menu, then click the checkbox in theFull Control
row of theAllow
column. - Click the
Apply
button.
- Open
- Try building the project using Visual Studio using
x64
build target (this build for 64-bit Notepad++). You will know that the project is working correctly when Notepad++ starts up, andCSharpPluginPack
appears on the list of plugins. - Try changing the assembly version in NppCSharpPluginPack/Properties/AssemblyInfo.cs to
1.0.3.0
. - Try building the project again, then select
Plugins->CSharpPluginPack->About
from the Notepad++ dropdown menu. The title of the about form should readNppCSharpPluginPack v1.0.3
. If it does not, your project is not building correctly. - Copy the
testfiles
directory of the repo to the%ProgramFiles%/Notepad++/plugins/CSharpPluginPack
directory. - Run the tests. The third line of the test results file should read
No tests failed
. If you seeTests failed: Performance of something
on the third line, that's because you forgot step 7. - To test your project for 32-bit Notepad++, repeat steps 3-8 for
%ProgramFiles (x86)%/Notepad++/plugins
and change your build target tox86
.
This plugin is verified to work on versions of Notepad++ as old as v7.3.3, but it may have some bugs (see the CHANGELOG to see the what bugs may still exist).
It has also been tested and verified to work normally on the newest versions of Notepad++, v8.6.1 and v8.6.2 RC.
Every version of the template works on Windows 10 May 2019 update or later, or you must install .NET Framework 4.8.
- Kasper B. Graversen for creating the plugin pack that this is based on.
- jokedst for making the CsvQuery plugin to which I owe the original ideas behind my settings form and my adaptive styling of forms.
- And of course, Don Ho for creating Notepad++!