Nextpad++ for Mac Developer Guide & Resources
Technical reference for plugin developers and power users. For installation and download, see the Download page. For keyboard shortcuts and troubleshooting, see Online Help.
macOS Compatibility
Nextpad++ for Mac is a Universal Binary with native slices for both architectures. No Rosetta translation is needed on Apple Silicon.
| Requirement | Details |
|---|---|
| Operating System | macOS 11 (Big Sur) or later |
| Apple Silicon | Native arm64 — M1, M2, M3, M4, M5 at full speed |
| Intel | Native x86_64 — all Intel Macs supported by macOS 11+ |
| Disk Space | ~12 MB download, ~50 MB installed |
| RAM | 4 GB minimum, 8 GB recommended |
| Display | Retina / HiDPI supported natively via Core Text + Core Graphics |
| Code Signing | Apple Developer ID signed + Apple notarized (Gatekeeper accepted) |
Plugin Development Guide
Nextpad++ for Mac loads plugins as native .dylib dynamic libraries from ~/.notepad++/plugins/PluginName/PluginName.dylib. The plugin API mirrors the Windows interface, adapted for macOS conventions.
Required Exports
Every plugin must export these 5 functions with C linkage and NPP_EXPORT visibility:
extern "C" NPP_EXPORT void setInfo(NppData nppData);
extern "C" NPP_EXPORT const char* getName(void);
extern "C" NPP_EXPORT FuncItem* getFuncsArray(int *nbF);
extern "C" NPP_EXPORT void beNotified(SCNotification *notifyCode);
extern "C" NPP_EXPORT intptr_t messageProc(uint32_t msg, uintptr_t wParam, intptr_t lParam);
Core Data Structures
NppData — passed to setInfo():
struct NppData {
NppHandle _nppHandle; // routes NPPM_* messages
NppHandle _scintillaMainHandle; // primary editor (SCI_* messages)
NppHandle _scintillaSecondHandle; // secondary editor
NppSendMessageFunc _sendMessage; // function pointer (replaces Win32 SendMessage)
};
FuncItem — menu command descriptor:
struct FuncItem {
char _itemName[64]; // UTF-8 menu text (NPP_MENU_ITEM_SIZE)
PFUNCPLUGINCMD _pFunc; // command callback (nullptr = separator)
int _cmdID; // host-assigned command ID
bool _init2Check; // initial checkmark state
ShortcutKey *_pShKey; // optional keyboard shortcut
};
ShortcutKey — includes macOS _isCmd modifier:
struct ShortcutKey {
bool _isCtrl; // Control key
bool _isAlt; // Option key
bool _isShift; // Shift key
bool _isCmd; // Command key (macOS-specific)
UCHAR _key; // virtual key code
};
Key Differences from Windows
| Windows | macOS |
|---|---|
.dll (PE binary) | .dylib (Mach-O binary) |
__declspec(dllexport) | NPP_EXPORT (__attribute__((visibility("default")))) |
wchar_t* (UTF-16) | char* (UTF-8) |
::SendMessage(hwnd, msg, w, l) | nppData._sendMessage(handle, msg, w, l) |
HWND | uintptr_t (opaque, typedef NppHandle) |
Win32 dialogs (.rc) | Native AppKit (NSAlert, NSPanel) |
INI files (GetPrivateProfileString) | JSON files (NSJSONSerialization) |
isUnicode() export required | Not needed (all strings are UTF-8) |
ShortcutKey has 4 fields | ShortcutKey has 5 fields (_isCmd added) |
Implemented NPPM Messages
Over 30 NPPM messages are handled by the macOS host:
| Message | Purpose |
|---|---|
| NPPM_GETCURRENTSCINTILLA | Get active editor handle (0=main, 1=secondary) |
| NPPM_GETCURRENTLANGTYPE | Get canonical LangType integer for current buffer |
| NPPM_GETLANGUAGENAME | Get display name for a LangType integer |
| NPPM_GETFULLCURRENTPATH | Get full file path of active buffer |
| NPPM_GETFILENAME | Get file name only |
| NPPM_GETEXTPART | Get file extension only |
| NPPM_GETCURRENTDIRECTORY | Get directory of active file |
| NPPM_GETFULLPATHFROMBUFFERID | Get path from a buffer ID |
| NPPM_DOOPEN | Open a file by path |
| NPPM_SAVECURRENTFILE | Save the active buffer |
| NPPM_SETMENUITEMCHECK | Set/clear checkmark on a plugin menu item |
| NPPM_GETPLUGINSCONFIGDIR | Get plugins/Config/ directory path |
| NPPM_GETPLUGINHOMEPATH | Get plugins/ directory path |
| NPPM_ALLOCATECMDID | Allocate a block of command IDs |
| NPPM_ALLOCATEMARKER | Allocate a marker ID |
| NPPM_ALLOCATEINDICATOR | Allocate an indicator ID |
| NPPM_MENUCOMMAND | Execute a host menu command by ID |
| NPPM_MSGTOPLUGIN | Send a message to another plugin |
| NPPM_ISDARKMODEENABLED | Check if the host is in dark mode |
| NPPM_SETPLUGINSUBSCRIPTIONS | Opt out of SCN_UPDATEUI/SCN_PAINTED (macOS-specific) |
The full list of defines is in NppPluginInterfaceMac.h on GitHub.
Notifications Emitted by the Host
| Notification | When |
|---|---|
| NPPN_READY | Host finished initializing, plugins loaded |
| NPPN_SHUTDOWN | Host is about to exit |
| NPPN_BEFORESHUTDOWN | Host is starting shutdown sequence |
| NPPN_TBMODIFICATION | Toolbar is ready for plugin icons |
| NPPN_BUFFERACTIVATED | A different tab was selected |
| NPPN_FILESAVED | A file was saved |
| NPPN_LANGCHANGED | Buffer language changed |
Scintilla notifications forwarded: SCN_MODIFIED, SCN_CHARADDED, SCN_UPDATEUI, SCN_PAINTED, SCN_AUTOCSELECTION, SCN_AUTOCCANCELLED.
Building a Plugin
Minimal CMakeLists.txt:
cmake_minimum_required(VERSION 3.20)
project(MyPlugin LANGUAGES CXX OBJCXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_OBJCXX_STANDARD 17)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
set(NPP_MACOS_DIR "/path/to/notepad-plus-plus-macos")
set(SCINTILLA_INCLUDE "/path/to/scintilla/include")
add_library(MyPlugin SHARED src/MyPlugin.mm)
target_include_directories(MyPlugin PRIVATE
${NPP_MACOS_DIR}/src ${SCINTILLA_INCLUDE})
target_link_libraries(MyPlugin PRIVATE "-framework Cocoa")
set_target_properties(MyPlugin PROPERTIES PREFIX "" SUFFIX ".dylib")
Build:
mkdir build && cd build && cmake .. && make -j$(sysctl -n hw.ncpu)
Install: copy MyPlugin.dylib to ~/.notepad++/plugins/MyPlugin/ and restart Notepad++.
Submitting to the Plugin Registry
- Create a GitHub repo, create a Release with a ZIP containing
PluginName/PluginName.dylib - Compute SHA256:
shasum -a 256 PluginName.zip - Add an entry to nppPluginList/pl.macos-arm64.json
- Open a pull request — once merged, the plugin appears in Plugin Admin automatically
Configuration & Data Directory
All configuration lives under ~/.notepad++/. To back up or migrate your setup, copy the entire directory.
Plugins should store config in plugins/Config/ by calling NPPM_GETPLUGINSCONFIGDIR in setInfo(). Do not hardcode ~/.notepad++/ directly.
Contribute
Nextpad++ for Mac is open source under GPL v3. Contributions are welcome:
- Port a plugin — adapt to
NppPluginInterfaceMac.h, build as universal dylib, submit to the plugin registry - Report a bug — open an issue on GitHub
- Fix a bug or add a feature — fork the main repo, open a pull request
- Improve docs — PRs welcome on the website repo
Read more on the About page or meet the authors.