Created
July 6, 2022 11:54
-
-
Save dzzzchhh/792f55ac9b106014d57e7b63ded02bda 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
(defun gist/create-from-region (start end) | |
(interactive "r") | |
(setq contents (buffer-substring start end)) | |
(setq new-file-name | |
(read-string "Enter filename: ")) | |
(setq visibility (ivy-completing-read "Specify gist's visibility: " '("public" "secret"))) | |
(write-region start end new-file-name) | |
(shell-command (format "gh gist create %s --%s" new-file-name visibility)) | |
(delete-file new-file-name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment