Skip to content

Instantly share code, notes, and snippets.

@cpbotha
Created April 10, 2023 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpbotha/dd783bffd4d57e22dd714a702cf6ade4 to your computer and use it in GitHub Desktop.
Save cpbotha/dd783bffd4d57e22dd714a702cf6ade4 to your computer and use it in GitHub Desktop.
(use-package webpaste
:ensure t
:bind (("C-c C-p C-b" . webpaste-paste-buffer)
("C-c C-p C-r" . webpaste-paste-region)
("C-c C-p C-p" . webpaste-paste-buffer-or-region))
:config
;; we can't use github gists, because the creation API requires a token in the header
;; see https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#create-a-gist
;; and open PR: https://github.com/etu/webpaste.el/pull/57
;; - dpaste.org fast, with (auto?) syntax highlighting, but dark mode
;; - django! https://github.com/DarrenOfficial/dpaste
;; - also uses cloudflare, which I like
;; - ix.io slower, but webpaste lang detection works (appends e.g. /python)
;; - paste.rs fast, but webpaste forgets to append .py to returned link -- I
;; could make it work, but would need a little work. solarized light euw
;; - bpa.st fastest, good colours, language built in. my favourite now.
;; - discovered coincidentally via #emacs after the ones above!
(setq webpaste-provider-priority '("bpa.st" "dpaste.org" "ix.io" "paste.rs" ))
;; fix emacs-lisp handling for bpa.st, add csharp
;; to see list of lexers access https://bpa.st/api/v1/lexer
(plist-put (cdr (assoc "bpa.st" webpaste-providers-alist))
:lang-overrides '((emacs-lisp-mode . "emacs-lisp")
(csharp-mode . "csharp")
(csharp-ts-mode . "csharp"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment