Python Editor

approved

by Juan Miguel Dela Cruz

Browse and edit Python files with Lezer-powered structure, highlighting, search, and auto-save. - This plugin has not been manually reviewed by Obsidian staff.

121 downloadsUpdated 28d agoMIT

Python Editor

Python Editor is an Obsidian plugin for viewing and editing .py and .pyi source files with CodeMirror 6.

Features

  • 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+F search and Ctrl/Cmd+H replace shortcuts.
  • Automatic saving through Obsidian's TextFileView save 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.

Development

npm install
npm run typecheck
npm run build

Copy main.js, manifest.json, and styles.css into:

<vault>/.obsidian/plugins/python-editor/

Then reload Obsidian and enable Python Editor.

Editor architecture

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.

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.