macOS port of the Windows Notepad++ plugin NppStripIpAndHost by larreblarsson — for Nextpad++ (the macOS port of Notepad++).
It sanitizes the active document by replacing IP addresses (IPv4 & IPv6) and hostnames / URLs with configurable placeholder strings — handy for scrubbing server logs and configs before sharing.
- Strip IPs and Hostnames — run the replacement over the current document.
- Undo Last Strip — restore the pre-strip text for this document only (a per-document backup, independent of the editor's own undo stack).
- Replace Settings… — open the settings dialog.
- IPv4 — four octets, each with its own replace checkbox and a placeholder
field. Unchecked octets keep their original value; checked octets are replaced
with your text (defaults
qqq.xxx.yyy.zzz). - IPv6 — checkbox + placeholder (default
2001:db8:0:0:0:0:0:1). - Host/URL — checkbox + placeholder (default
hostname.com).
Settings are persisted to
<plugins config dir>/NppStripIpAndHost/NppStripIpAndHost.ini.
(The original Windows plugin kept settings only in memory for the session; this
port persists them across restarts.)
- The replacement logic (regexes, per-octet IPv4 format building, per-document
undo keyed by the Scintilla doc pointer) is ported verbatim from the Windows
source. Only the platform layer changed:
- Win32
DIALOGresource → programmatic AppKitNSWindow(modal). ::SendMessage→nppData._sendMessage.MessageBox→NSAlert; status updates →NPPM_SETSTATUSBAR.
- Win32
- The Windows wait-cursor (
SetCursor(IDC_WAIT)) is dropped: macOS has no app-global busy pointer a plugin can set without owning the run loop, and the regex pass is effectively instantaneous for normal documents. Status-bar messages provide the feedback instead. - The IPv4/IPv6/hostname regexes are taken unchanged from upstream. As upstream,
they are intentionally simple (e.g. the IPv4 pattern does not range-check
octets to 0–255), so non-routable matches like
999.1.2.3are treated as IPv4 — this matches the Windows plugin's behaviour exactly.
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -jProduces a universal (arm64 + x86_64) NppStripIpAndHost.dylib. Copy it into a
NppStripIpAndHost/ folder inside the Nextpad++ plugins directory
(~/Library/Application Support/Nextpad++/plugins/) and restart.
GPL v2 (see LICENSE) — same as the upstream plugin.