Files
Obsidian-Main/22.01. 軟體工具、設定/copilot/Prompt Variable.md
Awin Huang 9412abbd19 vault backup: 2025-10-22 16:41:08
Affected files:
22.01. 軟體工具、設定/copilot/Prompt Variable.md
2025-10-22 16:41:08 +08:00

1.5 KiB

tags, aliases, date, time, description
tags aliases date time description
2025-10-22 16:37:25
  • Syntax:  You reference variables using the ${variableName} syntax within the prompt file.

  • Types of Variables:

    • Workspace Variables:
      • ${workspaceFolder}: The absolute path to the root of the current workspace.
      • ${workspaceFolderBasename}: The name of the workspace folder.
    • Selection Variables:
      • ${selection}: The currently selected text in the active editor.
      • ${selectedText}: Another way to refer to the currently selected text.
    • File Context Variables:
      • ${file}: The absolute path to the currently active file.
      • ${fileBasename}: The name of the active file, including its extension.
      • ${fileDirname}: The directory name of the active file.
      • ${fileBasenameNoExtension}: The name of the active file without its extension.
    • Input Variables:
      • ${input:variableName}: Prompts the user to enter a value for the specified variableName when the prompt is run.
      • ${input:variableName:placeholder}: Similar to the above, but includes a placeholder text within the input field.

參考來源