You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
3.5 KiB
95 lines
3.5 KiB
* Webpaste.el -- Paste text to pastebin-like services |
|
[[https://www.gnu.org/licenses/gpl-3.0.txt][https://img.shields.io/badge/license-GPL_3-green.svg]] |
|
[[https://melpa.org/#/webpaste][https://melpa.org/packages/webpaste-badge.svg]] |
|
[[https://stable.melpa.org/#/webpaste][https://stable.melpa.org/packages/webpaste-badge.svg]] |
|
[[https://travis-ci.org/etu/webpaste.el][https://travis-ci.org/etu/webpaste.el.svg?branch=master]] |
|
[[https://coveralls.io/github/etu/webpaste.el?branch=master][https://coveralls.io/repos/github/etu/webpaste.el/badge.svg?branch=master]] |
|
|
|
This mode allows to paste whole buffers or parts of buffers to |
|
pastebin-like services. It supports more than one service and will |
|
failover if one service fails. More services can easily be added |
|
over time and prefered services can easily be configured. |
|
|
|
** Installation |
|
*** The lazy way (Using [[https://github.com/jwiegley/use-package][use-package]]) |
|
This requires that you have [[https://github.com/jwiegley/use-package][use-package]] set up. But it's in my opinion the |
|
easiest way to install and configure packages. |
|
|
|
#+BEGIN_SRC emacs-lisp |
|
(use-package webpaste |
|
:ensure t |
|
:bind (("C-c C-p C-b" . webpaste-paste-buffer) |
|
("C-c C-p C-r" . webpaste-paste-region))) |
|
#+END_SRC |
|
|
|
** Configuration |
|
*** Choosing providers / provider priority |
|
To select which providers to use in which order you need to set the variable |
|
=webpaste-provider-priority= which is a list of strings containing the |
|
providers names. |
|
|
|
Examples: |
|
#+begin_src emacs-lisp :tangle yes |
|
;; Choosing githup gist only |
|
(setq webpaste-provider-priority '("gist.github.com")) |
|
|
|
;; Choosing ptpb.pw as first provider and dpaste.de as second |
|
(setq webpaste-provider-priority '("ptpb.pw" "dpaste.de")) |
|
|
|
;; Choosing 1) ptpb.pw, 2) dpaste.de, 3) ix.io |
|
(setq webpaste-provider-priority '("ptpb.pw" "dpaste.de" "ix.io")) |
|
|
|
;; You can always append this list as much as you like, and which providers |
|
;; that exists is documented below in the readme. |
|
#+end_src |
|
|
|
This can be added to the =:config= section of use-package: |
|
#+BEGIN_SRC emacs-lisp |
|
(use-package webpaste |
|
:ensure t |
|
:bind (("C-c C-p C-b" . webpaste-paste-buffer) |
|
("C-c C-p C-r" . webpaste-paste-region)) |
|
:config |
|
(progn |
|
(setq webpaste-provider-priority '("ptpb.pw" "dpaste.de")))) |
|
#+END_SRC |
|
|
|
*** Confirm pasting with a yes/no confirmation before pasting |
|
To enable a confirmation dialog to always pop up and require you to confirm |
|
pasting before text is actually sent to a paste-provider you just need to set |
|
the variable =webpaste/paste-confirmation= to a value that is non-nil. |
|
|
|
Example: |
|
#+begin_src emacs-lisp :tangle yes |
|
;; Require confirmation before doing paste |
|
(setq webpaste/paste-confirmation t) |
|
#+end_src |
|
|
|
Can also be put in the =:config= section of =use-package= the same way as the |
|
provider definitions above. |
|
|
|
*** Open recently created pastes in browser |
|
To enable opening of recently created pastes in an external browser, you can |
|
enable the option =webpaste/open-in-browser= by setting this value to a |
|
non-nil value. |
|
|
|
Example: |
|
#+begin_src emacs-lisp :tangle yes |
|
;; Open recently created pastes in an external browser |
|
(setq webpaste/open-in-browser t) |
|
#+end_src |
|
|
|
Can also be put in the =:config= section of =use-package= the same way as the |
|
provider definitions above. |
|
|
|
** TODO Providers to implement [7/10] |
|
- [X] ptpb.pw |
|
- [X] ix.io |
|
- [X] dpaste.com |
|
- [X] sprunge.us |
|
- [X] dpaste.de |
|
- [X] gist.github.com |
|
- [X] paste.pound-python.org |
|
- [ ] paste.debian.net |
|
- [ ] bpaste.net |
|
- [ ] eval.in
|
|
|