Repository navigation
Getting Started
Federico Conticello edited this page Mar 24, 2026
·
2 revisions
Create your first FerrisPad plugin in 5 minutes.
A plugin is a directory with at least two files:
my-plugin/
init.lua # Plugin logic
plugin.toml # Metadata and configuration
Create plugin.toml:
name = "Hello World"
version = "0.1.0"
description = "A simple example plugin"Create init.lua:
local M = {}
function M:init(api)
api:log("Hello World plugin loaded!")
end
function M:on_document_open(api, path)
if path then
api:log("Opened: " .. path)
end
end
function M:on_document_save(api, path, content)
local line_count = 0
for _ in content:gmatch("[^\n]*\n") do
line_count = line_count + 1
end
return {
status_message = {
level = "info",
text = "Saved " .. line_count .. " lines"
}
}
end
return MCopy the plugin directory to the plugins folder:
cp -r my-plugin/ ~/.config/ferrispad/plugins/Restart FerrisPad or go to Plugins > Reload All.
Open any file — you should see "Hello World plugin loaded!" in stderr (if running from terminal). Save a file and you'll see a toast notification with the line count.
- Add Hooks Reference to react to other events
- Use the Editor API to read document content
- Use the Widget API to display results in tree views or split panels
- Add Plugin TOML Reference to your manifest
- FerrisPad discovers plugins in
~/.config/ferrispad/plugins/ - Each directory containing
init.luais loaded -
plugin.tomlis parsed for metadata, permissions, menu items, and config - The Lua file is executed in a sandboxed environment
-
init(api)is called once - Event hooks are called as the user interacts with the editor
-
shutdown(api)is called when FerrisPad exits