crates/fresh-editor/plugins/examples/README.md
This directory contains example plugins demonstrating the editor's plugin system. These are educational examples showing specific API features.
For the complete API reference, see docs/plugins/api/index.md.
A simple "Hello World" plugin that demonstrates:
Demonstrates async process spawning:
spawnProcessDemonstrates buffer queries:
getBufferInfoDemonstrates virtual buffer creation:
createVirtualBufferInSplitA complete bookmark management example:
Git grep implementation demonstrating:
.ts file in the plugins directoryeditor global object to access the APIeditor.registerCommand()Example template:
/// <reference path="../types/fresh.d.ts" />
// Define the command handler
globalThis.my_command = function(): void {
editor.setStatus("My command executed!");
};
// Register the command
editor.registerCommand(
"My Custom Command",
"Does something cool",
"my_command"
);
// Initialization message
editor.debug("My custom plugin loaded");