PPocket Editor DOCUMENTATION
Plugins / POCKET EDITOR

Bundled plugin catalog

Every loadable plugin in the source tree is listed below. Helpers beginning with _ are not standalone plugins. Commands and service/event names are extracted from the Python syntax tree without executing plugins. Event lists show statically declared names, not every dynamic event.

Plugins

Python files in pocket_editor_plugins/ define register(api). Plugin IDs are filename stems. Plugins load in filename order and repeated Load New Plugins does not register them twice.

The API supports commands, text access/replacement, paths, events, services, and discovery. api.list_services() returns qualified service names. api.on_cleanup(callback) registers cleanup for failed registration or editor exit. Event callbacks and service calls execute on the GUI thread. Event payload key source is reserved. Plugins are trusted Python code; plugins that access private editor internals must register cleanup for their own side effects.

The terminal is an output-only shell runner. Its output queue and retained text are bounded; retained text is limited to 200,000 characters and individual long lines retain their last 8,192 characters. Stop and application exit terminate the process group on POSIX. Deliberately detached processes are outside this guarantee. Windows process-tree handling needs platform verification.

Regex searches run in a disposable Python process with a 0.5-second execution timeout and a 100,000-match limit. A search may briefly pause the GUI while that bounded operation completes. Syntax highlighting pauses above 300,000 document characters.

Plugin Builder

Use Extensions → Plugin Builder… to preview, create, and load a command, text transform, tool window, or event/service plugin. Existing plugin files are protected from overwriting. See Plugin development and API reference for the tutorial, templates, events, services, cleanup, testing, and reload workflow.

Plugin Manager

Choose Extensions → Plugin Manager…, Settings → Plugin Manager…, or find it through Ctrl+Shift+P. Search by plugin ID or status, select a plugin, and inspect its path, registered commands, subscribed events, services, and latest loading or command error. Open source opens the file in an editor tab. Refresh rescans installed plugins; Load new plugins retries failed registrations and loads newly enabled plugins that have not already loaded.

Enable/Disable persists startup preferences in disabled_plugins in the editor settings. Disabling a loaded plugin takes effect after restarting; it does not remove running callbacks or existing menu commands mid-session. Enabling an unloaded plugin allows Load new plugins to load it. Edited plugins that already loaded require a restart. Failed settings writes roll back the requested toggle. Runtime errors remain visible until restart; successful registration clears a previous loading error.

In --safe-mode, use Settings → Plugin Manager… to disable a broken plugin, then restart normally. Loading remains disabled while in safe mode. The manager reports the current process's registered events and services, not a dependency manifest or every event a plugin might emit. Helpers beginning with _ are excluded.

Run python3 -B -m unittest -v test_plugin_manager for startup preferences, safe mode, plugin communication inspection, error retry, and settings-failure checks.

Inline syntax diagnostics

The Python Tools plugin combines Black formatting, Python Format Settings, and Python/JSON syntax diagnostics. Its services are python_tools.format, python_tools.check, and python_tools.get_status. Existing formatter settings are preserved.

The syntax_diagnostics plugin checks saved Python (.py, .pyw, .pyi) and JSON (.json) filenames after a 450 ms typing pause. Checks use the current unsaved buffer, run in a background worker, and never execute user code. The first syntax error gets a red underline and a clickable line/column message below the editor. Fixing the error clears the marker. Results from a changed or switched document are discarded.

Search the palette for Check Syntax, Go to Syntax Error, or Toggle Automatic Syntax Checks. Manual checks remain available when automatic checks are off; that toggle lasts for the current session. Untitled and unsupported filenames are not checked automatically. Checks skip files above 200,000 characters. Python uses the running interpreter's compiler; JSON uses Python's built-in JSON decoder. These are syntax checks, not type checking, undefined-variable analysis, or project-wide diagnostics. Undo, saving, and file contents are unaffected by checking.

Other plugins can request an asynchronous check through api.call_service("python_tools.check"), inspect api.call_service("python_tools.get_status"), and subscribe with api.on("syntax_diagnostics.updated", callback). The completion event contains source, path (string or None), and result with a status/message and line/column for syntax errors. The check service queues work and returns None. Disable the plugin through Plugin Manager if needed.

Choose Extensions → Load New Plugins or restart to enable it. Verify with python3 -B -m unittest -v test_syntax_diagnostics.

The Extensions toolbar dropdown groups commands by plugin to keep the menu compact. Add to toolbar uses the same plugin groups and shared checkmarks as the menubar. Plugins with more than 18 commands continue under More… rather than producing an oversized menu. Search Commands opens the command palette for direct access to every command. The menubar's Plugins menu remains available.

ai_assistant

Single Chat/Code AI Assistant with native Gemini, OpenAI Responses, compatible provider presets, model discovery, explicit text/code attachments and setup help.

How to use: Open AI Assistant, select Settings and choose Google Gemini or another provider. Enter that provider’s API key, Refresh models, choose a text model and Save. How to use opens the complete Gemini setup example. Chat and Code modes share explicit attachments and local limits.

Commands: AI Assistant….

Services: ai_assistant.get_status.

Published events: ai_assistant.reply.

View source

code_theme

Dark, Light, Dracula, and Solarized Dark document themes with bounded syntax highlighting. Theme choices do not replace editor chrome.

How to use: Open Code Theme, choose a color scheme and language, and close the dialog. Auto selects highlighting from the filename extension. Highlighting stops above 300,000 characters; text remains editable.

Commands: Code Theme.

Services: code_theme.refresh.

Subscribed events: document_switched, document_changed, document_formatted.

View source

editor_commands

Fourteen everyday line-editing, tab-navigation, clipboard-path, and zoom commands. Line changes support Undo; tab closing checks unsaved edits.

How to use: Place the cursor on a line or select several lines, then invoke a line command from the palette. Selection ending at the next line’s column zero excludes that next line. Go to Line asks for a valid line number. Copy Path needs a saved filename. Zoom preferences persist.

Commands: Duplicate Line / Selection, Move Lines Up, Move Lines Down, Delete Lines, Trim Trailing Whitespace, Go to Line…, Copy File Path, Copy Folder Path, Next Tab, Previous Tab, Close Other Tabs, Zoom In, Zoom Out, Reset Zoom.

View source

git_project

Independent Git tools for any project: automatic init, shared repository service, local Git settings, clone, origin, status, commits, pull, and push. Optional Explorer integration.

How to use: Open Git Project or use Explorer Actions. Browse selects a folder and initializes Git if absent; Set Git Folder prepares a typed path. The repository root is available through ensure_repository/get_repository services. Clone downloads a repository. Set Origin configures its remote. Save files, Refresh, select changes, and Commit Selected. Push publishes; Pull only fast-forwards and requires closed project tabs. Settings edits repository-local author identity, origin, line endings, executable-bit tracking, and commit signing; blank/Inherit uses inherited defaults. On Windows use Git setup to detect installed Git, browse git.exe, verify/save its path, or install through winget/the official installer.

Commands: Git Project.

Services: git_project.open_project, git_project.ensure_repository, git_project.get_repository, git_project.get_project.

Published events: git_project.repository_changed, project_changed.

View source

php_tools

One PHP plugin for Prettier formatting, Intelephense completion, settings and reindexing.

How to use: Format PHP and PHP Format Settings control Prettier formatting. PHP Completion, its Settings/Help, and Reindex PHP Project control the Intelephense server. Ctrl+Space requests completion.

Commands: Format PHP, PHP Format Settings, PHP Completion, PHP Completion Settings, PHP Completion Help, Reindex PHP Project.

Services: php_tools.format, php_tools.busy, php_tools.complete, php_tools.status.

Subscribed events: document_changed, document_saved, project_changed.

Published events: document_formatted.

View source

plugin_builder

Preview and create a simple command, text transform, tool window, or event/service plugin. Exclusive creation protects existing files.

How to use: Choose a unique lowercase plugin ID, command label, description, and template. Inspect Code preview and Documentation, then Create & load. A source tab opens for editing. Restart after changing an already-loaded plugin. The Plugin communication page lists loaded IDs/services; Refresh services updates it.

Commands: Plugin Builder….

View source

project_explorer

Project tree with Open/Save/Load project controls, file operations, and launchers for independent Git and hosted teamwork.

How to use: Choose Open Project and select a folder. Expand the tree and double-click a file, or press Enter. Use Actions or the context menu for New File, New Folder, Rename, Delete, and Refresh. Rename is also available through F2. File operations require explicit UI actions and retain unsaved-file protection.

Commands: Open Project Folder…, Load Project…, Save Project, Save Project As…, Git Project…, Team Project…, Open File, New File…, New Folder…, Rename…, Delete…, Refresh, Project Explorer, Open Project, Load Project, Save Project As.

Services: project_explorer.get_project, project_explorer.open_project.

Subscribed events: project_changed.

Published events: project_changed, document_changed.

View source

project_terminal

Output-only system-shell runner with stop controls, per-project commands, ANSI rendering, semantic categories, and portable appearance preferences.

How to use: Set a working directory and command, then Run. Stop terminates the process group where supported. Save Project Command remembers the command for that directory. Settings configures presets, ANSI colors, categories, font/encoding, and force-color. This runner has no interactive input.

Commands: Project Terminal, Project Terminal Settings….

Services: project_terminal.show, project_terminal.get_settings.

Published events: terminal_settings_changed, command_finished.

View source

python_tools

One Python plugin for Black formatting and background Python/JSON syntax diagnostics.

How to use: Open Python Format Settings or Format Python for optional Black formatting. Check Syntax, Go to Syntax Error and Toggle Automatic Syntax Checks provide non-executing Python/JSON validation.

Commands: Format Python, Python Format Settings, Check Syntax, Go to Syntax Error, Toggle Automatic Syntax Checks.

Services: python_tools.format, python_tools.get_status, python_tools.check.

Subscribed events: document_changed, document_switched, document_saved.

Published events: document_formatted, syntax_diagnostics.updated.

View source

rich_text

Text styles and formatted .pocket copies. Plain-text Save does not preserve formatting. Text Undo is available; formatting Undo is not implemented.

How to use: Select text before applying Bold, Italic, Underline, Strikeout, font, size, text color, or highlighting. Paragraph alignment affects the relevant paragraphs. Clear Formatting removes rich tags from the selection. Save Formatted Copy creates a .pocket file; Open Formatted loads one into a new tab. Formatting changes require a formatted copy to preserve them.

Commands: Rich Text.

View source

search_replace

Find and replace with previous/next navigation, regex options, and bounded regex execution in a disposable process.

How to use: Open Search & Replace, enter the search and optional replacement, choose case/regex options, then use Next or Previous. Replace selects the next match before replacing if no matching active result is selected; Replace All works on the active document. Regex replacements support capture references. Invalid expressions and bounded-search failures are shown without replacing the document.

Commands: Search & Replace.

Published events: document_changed.

View source

team_project

Host/client project copies, individual keys, portable client invitations, modern group chat, and audio/video/file exchange.

How to use: Choose Host a project or Join as client. Host mode shows its actual listen port and suggests a LAN address. Easy Internet Setup detects OS/CPU, installs a checksum-verified user-local cloudflared, and starts a temporary HTTPS relay. Only a verified relay URL is filled into invitations. It also exports setup commands/scripts. Client mode loads an invitation; no client listening port is needed. Details shows local and peer endpoints; the host client list shows last observed IPs/source ports. Under Project Copies, generate a named client key and export a .team-invite using a reachable server URL. Detect My Public IP is at the top for both roles before connecting and uses HTTPS fallback services with visible DNS/network errors; Use HTTPS IP sets the invitation address only after an explicit click. HTTPS and actual inbound reachability must be configured separately. The client loads that invitation, chooses a local copy folder, and clicks Join Team. Use Group Chat and Shared Files to communicate, and Project Copies to pull or send saved file changes.

Commands: Team Project.

Services: team_project.open_project.

View source

text_formatting

Preview transformations for selection or document: case changes, whitespace cleanup, indentation, sorting, and duplicate-line removal.

How to use: Select a region or leave no selection to target the whole document. Open Text Formatting, choose an operation and indentation width, and review the preview. Apply Formatting performs an undoable change. If the document or selected range changed while the dialog was open, reopen the formatter instead of applying stale results.

Commands: Text Formatting.

View source

word_count

Counts words in the selected document and displays the result.

How to use: Choose Count words to count whitespace-separated words in the whole active document, including unsaved edits. A text selection does not restrict this count.

Commands: Count words.

View source

Created by Somi Douth · Built with Python and Tkinter