Created
November 26, 2024 16:01
-
-
Save johnlindquist/33d2a49762f1481a302b51c4801d5e29 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
/* | |
# Create a Gist | |
- Opens the built-in editor | |
- Saving automatically creates a Gist | |
- Opens the Gist in your browser | |
*/ | |
// Name: Create Gist | |
// Description: Quickly Save Text as a Gist | |
import { backToMainShortcut } from "@johnlindquist/kit"; | |
let contents: string = await editor({ | |
shortcuts: [ | |
backToMainShortcut, | |
{ | |
name: "Post Gist", | |
key: `${cmd}+s`, | |
bar: "right", | |
onPress: async (input: string) => { | |
submit(input); | |
}, | |
}, | |
], | |
}); | |
let { html_url } = await createGist(contents); | |
open(html_url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment