An example plugin for nib, written in Go with its Go SDK. It shows how many words the shown buffer has in the status line, and answers the wordcount.count command with the number.
nib plugin add nib-editor/plugin-exampleIt needs no capabilities. It loads the next time nib starts.
You need TinyGo 0.42 or later (with Go 1.25 to 1.27), binaryen's wasm-opt, and wasm-tools.
tinygo build -target=wasip2 \
--wit-package "$(go list -m -f '{{.Dir}}' github.com/nib-editor/nib/sdk/go)/wit" \
--wit-world plugin -o plugin.wasm .With nib 0.9 or later, nib plugin build runs the same command.
nib plugin testruns the tests in tests/ in an editor without a terminal. Try the build without installing it with nib --plugin ..
Set version in plugin.toml, then push a tag of the same version:
git tag v0.1.0 && git push origin v0.1.0The release workflow builds the plugin and publishes wordcount-0.1.0.nib.tar.gz, which nib plugin add and nib plugin update look for.
MIT