Prompt templating allows you to create dynamic prompts using special keywords that are replaced with actual content at runtime. This enables powerful workflows where selected text and vault context can be intelligently positioned in your prompts.
Use {{=SELECTION=}} to control where the selected text appears:Prompt:
{{=SELECTION=}}You are an assistant helping a user write more content in a document based on a prompt.
Selected text:
Some example text.
Final prompt sent to AI:
Some example text.You are an assistant helping a user write more content in a document based on a prompt.
This is useful when you want the AI to process the selected text before reading instructions, or when you want to embed selections within a structured template.
# Relevant contextSome example context about the selected text from some meaningful document.# Selected textSelected text with [[Some meaningful document]].
The {{=CONTEXT=}} keyword is replaced with a multiline string containing all relevant context chunks retrieved from your vault.
# TaskSelected text with [[Some meaningful document]].# ContextSome example context about the selected text from some meaningful document.# InstructionsDo something with the selected text.
# TaskSelected text with [[Some meaningful document]].# InstructionsDo something with the selected text.
The entire block between {{=CONTEXT_START=}} and {{=CONTEXT_END=}} is removed when no context is available. This includes any text, headers, or formatting within the block.
Prompt: | # Question {{=SELECTION=}} {{=CONTEXT_START=}} # Relevant Information from Vault {{=CONTEXT=}} {{=CONTEXT_END=}} # Instructions Answer the question thoroughly. Use information from the context when relevant, but don't be limited by it. If the context doesn't address the question, provide a general answer based on your knowledge.
Use case: Ask questions about topics in your vault, and the AI will use your notes as reference material.
Prompt: | # Code to Review {{=SELECTION=}} {{=CONTEXT_START=}} # Related Code and Documentation {{=CONTEXT=}} {{=CONTEXT_END=}} # Instructions Review this code for: - Potential bugs - Performance issues - Best practice violations - Security concerns Consider the related code and documentation when available.
Use case: Get AI code reviews that understand your project’s patterns and conventions.
Prompt: | {{=CONTEXT_START=}} # Research Notes and Sources {{=CONTEXT=}} {{=CONTEXT_END=}} # Research Question {{=SELECTION=}} # Instructions Based on the research notes provided, generate a comprehensive answer to the question. Include: - Direct answers from the sources - Synthesis of multiple sources - Identification of gaps or conflicts in the research
Use case: Synthesize information from multiple research notes when answering questions.
Prompt: | # Meeting Notes {{=SELECTION=}} {{=CONTEXT_START=}} # Previous Meeting Context {{=CONTEXT=}} {{=CONTEXT_END=}} # Task Analyze these meeting notes and generate: 1. **Summary**: Key discussion points 2. **Decisions**: What was decided 3. **Action Items**: Who needs to do what 4. **Follow-ups**: Questions or items for next meeting {{=CONTEXT_START=}} If previous meeting context is available, note any progress or changes since the last meeting. {{=CONTEXT_END=}}
Use case: Turn messy meeting notes into structured summaries with historical context.
Prompt: | {{=CONTEXT_START=}} # Writing Samples for Style Reference {{=CONTEXT=}} {{=CONTEXT_END=}} # Content to Rewrite {{=SELECTION=}} # Instructions Rewrite the content to match the style of the writing samples provided{{=CONTEXT_START=}} above{{=CONTEXT_END=}}. Focus on: - Tone and voice - Sentence structure - Vocabulary level - Formatting conventions
Use case: Rewrite content to match your established writing style based on examples in your vault.
If you don’t use template keywords, both selection and context are automatically appended:Prompt:
# TaskSome task.# InstructionsDo something with the selected text.
What you might expect:
# TaskSome task.# InstructionsDo something with the selected text.
What actually happens:
# TaskSome task.# InstructionsDo something with the selected text.Selected text with [[Some meaningful document]].Context:Some example context about the selected text from some meaningful document.
Always use {{=SELECTION=}} if you want to control where the selection appears. Otherwise it will be appended at the end.
When using {{=CONTEXT=}} without conditional blocks, you’ll get an empty line if no context is available:
// Without conditionals:# Context{{=CONTEXT=}} // This will be an empty line if no context// With conditionals:{{=CONTEXT_START=}}# Context{{=CONTEXT=}} // Entire block removed if no context{{=CONTEXT_END=}}
# Context Information{{=CONTEXT_START=}}{{=CONTEXT=}}{{=CONTEXT_END=}}# Your Content{{=SELECTION=}}# Task Requirements1. First requirement2. Second requirement3. Third requirement# Output FormatProvide your response as:- Bullet points- With clear headers- In markdown format