Skip to content

Snippets #56

@mkh-user

Description

@mkh-user

Feature Summary

Add support for user-defined snippets that can be quickly inserted into files. Snippets may include code blocks, text templates, or reusable structures, and should be accessible via shortcuts or command palette.

Motivation

Users often reuse common code patterns, documentation blocks, or configuration fragments. Manually typing or copying these each time is inefficient. A snippet system improves productivity, reduces repetition, and encourages consistency across files and projects.

Proposed Design

  • Introduce a snippets.txt in data directory to store user-defined snippets.
  • Each snippet includes a name, content, optional description, and trigger keyword.
  • Provide a UI or command palette interface to insert snippets into the current cursor position.
  • Support placeholders (e.g., {{cursor}}, {{date}}, {{filename}}) for dynamic insertion.

Acceptance Criteria

  • Users can define and manage custom snippets.
  • Snippets can be inserted via shortcut, command palette, or context menu.
  • Placeholders are correctly replaced during insertion.
  • Documentation includes instructions and examples for snippet creation.

Related Issues / Discussions

  • Template system #2: These issues are similar so we can use template manager and placeholders system here.

Implementation Notes (Optional)

  • Use structured text for snippet definitions.
  • Support import/export of snippet collections for sharing.

Localization & Accessibility

Nothing

Community Feedback (Optional)

Nothing

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedOpen for community input, suggestions, or implementation help

    Projects

    Status

    Accepted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions