Created
November 28, 2024 15:52
-
-
Save johnlindquist/b2fdc2e5c0ee1efb70b9a18e3b18d5b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Testing Template with Selection | |
// Shortcut: opt 7 | |
import "@johnlindquist/kit"; | |
const selectedText = await getSelectedText(); | |
const templates = [ | |
{ | |
name: "par", | |
trigger: "par", // just type "par" and it will run | |
value: selectedText.trim() ? `(${selectedText}) $0` : `($1)$0`, | |
}, | |
]; | |
const text = await arg("Select a template", templates); | |
const result = await template(text); | |
await setSelectedText(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment