Skip to content

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages