TIL - making an Obsidian plugin (minimal guide)

1. Minimal plugin (main.js):
js module.exports = class EditSelectionPlugin { onload() { this.addCommand({ id: 'edit-selection', name: 'Edit Selected Text', editorCallback: (editor) => { const sel = editor.getSelection(); editor.replaceSelection(sel.toUpperCase()); } }); } } `

2. manifest.json: json { "id": "edit-selection", "name": "Edit Selection", "version": "1.0.0", "minAppVersion": "0.1.0", "author": "You", "main": "main.js" }

3. Enable it:
Place both files in <vault>/.obsidian/plugins/edit-selection/
Reload Obsidian → Settings → Community Plugins → Enable “Edit Selection”
Use Cmd+P → Edit Selected Text