Skip to content

Advanced Paste: Custom template library + quick switching + direct paste hotkeys #45418

@1zhujianbang

Description

@1zhujianbang

Description of the new feature / enhancement

Please enhance PowerToys Advanced Paste with template-based pasting , allowing users to create and reuse a set of custom paste templates. Users should be able to quickly switch templates in the Advanced Paste UI, and optionally bind a dedicated hotkey to a template for “no-panel, transform-and-paste” workflows.

Core capability (single request: a Template Library)

  • Add a Templates management page under PowerToys Settings > Advanced Paste :

    • Create / edit / delete templates with:
      • Name
      • Output format (PlainText / Markdown / HTML / JSON / Auto)
      • Template body
    • Support placeholders (examples):
      • {{clipboard_text}}
      • {{clipboard_html}}
      • {{date}} , {{time}}
      • {{newline}}
    • (Optional but very important) support simple filters:
      • {{clipboard_text | trim}}
      • {{clipboard_text | json_escape}}
    • Provide a Preview area:
      • Shows “clipboard input” and “rendered output” before applying
  • Add a Templates section in the Advanced Paste panel (e.g., Win+Shift+V):

    • Templates are searchable, pinnable, and can be sorted by recent usage
    • Keyboard quick selection (e.g., Ctrl+1..0 or 1..0 when the panel is open)
  • Allow optional per-template global hotkeys :

    • Hotkey action: read clipboard → apply template → write back to clipboard (respecting output format) → paste (Ctrl+V or a safer paste mechanism)
    • Enables “snippet-like” high-frequency formatted pastes without opening the panel every time
      This enhancement should be fully local and deterministic (no AI, no network required), making it suitable for offline/enterprise environments and easier to control and reproduce.

Scenario when this would be used?

I frequently need to wrap or transform clipboard content into a consistent format before pasting into browsers, docs, ticketing systems, Markdown editors, and code review tools. Examples:

  • Turn arbitrary copied text into Markdown quote blocks, code blocks, or table rows
  • Convert copied links/titles into a fixed format like title or a ticket reference style
  • Turn text into JSON field values (requires correct escaping) for configs and API tools
  • Paste plain text only into browser forms (avoid rich formatting) while adding prefixes/suffixes (quotes, tags, etc.)
  • When asking AI, wrap raw info into a prompt template and paste the composed “advanced prompt” text
    These are workflows done dozens of times per day . Templates + hotkeys would significantly increase Advanced Paste’s practical value.

Supporting information

Template examples

  1. Markdown quote

    {{clipboard_text}}

  2. Markdown code block
```text
{{clipboard_text}}
3. JSON field (needs escaping)
    {"text":"{{clipboard_text | json_escape}}"}
4. Browser-friendly plain text (trim / normalize)
    {{clipboard_text | trim}}
Why this fits Advanced Paste

- Advanced Paste already converts clipboard data into other formats before pasting. A template library generalizes that capability from fixed actions to user-configurable transformations that match real workflows.
- Templates naturally benefit from PowerToys settings features (sync/backup/import/export).
Acceptance criteria (high level)

- Users can create templates and apply them from the panel; output is pasted in the chosen format
- Templates can be bound to global hotkeys for direct transform-and-paste without opening the panel
- Support at least {{clipboard_text}} and {{clipboard_html}} , plus a basic json_escape filter (critical for JSON/code-related use cases)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageFor issues raised to be triaged and prioritized by internal Microsoft teamsduplicateThis label was added by a GitHub action and this issue may be a potential duplicate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions