Created
March 18, 2024 12:08
-
-
Save JoepKockelkorn/f888ffb0ade8a12def78446c942c21da 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
// Menu: Surround text with | |
// Description: Surround the selected text with some input | |
// Snippet: | |
const text = await getSelectedText(); | |
const cmdEnterToEmit = { | |
name: "Submit", | |
key: "enter", | |
bar: "right", | |
onPress: async input => { | |
await submit(input) | |
}, | |
} | |
const surrounded = await template(`$1${text}$1`, { shortcuts: [cmdEnterToEmit] }); | |
await setSelectedText(surrounded); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment