Python Editor is an Obsidian plugin for viewing and editing .py and .pyi source files with CodeMirror 6.
- CodeMirror 6 editor with line numbers and Python syntax highlighting.
- Navigable code outline for classes, functions, methods, and the
__main__entry point. - Configurable default outline position: right, left, or hidden.
- Undo/redo, code folding, bracket matching, and Obsidian-styled find/replace.
- Obsidian-compatible
Ctrl/Cmd+Fsearch andCtrl/Cmd+Hreplace shortcuts. - Automatic saving through Obsidian's
TextFileViewsave lifecycle. - Mobile-compatible implementation with no Node.js or Electron runtime APIs.
- Python code is edited as text and is never executed by the plugin.
npm install
npm run typecheck
npm run buildCopy main.js, manifest.json, and styles.css into:
<vault>/.obsidian/plugins/python-editor/
Then reload Obsidian and enable Python Editor.
Python source
-> CodeMirror 6 editor
-> Python syntax highlighting and editing
-> Obsidian TextFileView save lifecycle
The editor uses CodeMirror's @codemirror/lang-python language support. Python source is never executed by the plugin.