emacsify denote bindings and add 0x0 support without package
- map denote bindings to C-c iso <leader> prefix - replace 0x0 package with 2 functions from @daviwil
This commit is contained in:
parent
f3e304cf00
commit
2beaac573d
1 changed files with 28 additions and 1 deletions
29
init.org
29
init.org
|
@ -3226,12 +3226,39 @@ Configures the ~0x0~ package for easily sharing code snippets and files:
|
|||
#+BEGIN_SRC emacs-lisp
|
||||
;; configure 0x0
|
||||
(use-package 0x0
|
||||
:disabled
|
||||
:ensure t
|
||||
:config (setq 0x0-use-curl t))
|
||||
|
||||
(defun 0x0-upload-text ()
|
||||
(interactive)
|
||||
(let* ((contents
|
||||
(if (use-region-p)
|
||||
(buffer-substring-no-properties (region-beginning) (region-end))
|
||||
(buffer-string)))
|
||||
(temp-file (make-temp-file "0x0" nil ".txt" contents)))
|
||||
(message "Sending %s to 0x0.st..." temp-file)
|
||||
(let ((url (string-trim-right
|
||||
(shell-command-to-string
|
||||
(format "curl -s -F'file=@%s' -Fsecret= -Fexpires=24 https://0x0.st"
|
||||
temp-file)))))
|
||||
(message "Yanked â%sâ into kill ring." url)
|
||||
(kill-new url)
|
||||
(delete-file temp-file))))
|
||||
|
||||
(defun 0x0-upload-file (file-path)
|
||||
(interactive "fSelect a file to upload: ")
|
||||
(message "Sending %s to 0x0.st..." file-path)
|
||||
(let ((url (string-trim-right
|
||||
(shell-command-to-string
|
||||
(format "curl -s -F'file=@%s' -Fsecret= -Fexpires=24 https://0x0.st"
|
||||
(expand-file-name file-path))))))
|
||||
(message "Yanked â%sâ into kill ring." url)
|
||||
(kill-new url)))
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
: [nil 26279 35497 183387 nil elpaca-process-queues nil nil 963000 nil]
|
||||
: +0x0-upload-file
|
||||
|
||||
The commands this package offers:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue