Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created November 26, 2024 16:01
Show Gist options
  • Save johnlindquist/33d2a49762f1481a302b51c4801d5e29 to your computer and use it in GitHub Desktop.
Save johnlindquist/33d2a49762f1481a302b51c4801d5e29 to your computer and use it in GitHub Desktop.
/*
# 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