diff options
author | John Turner <jturner.usa@gmail.com> | 2024-03-08 14:04:22 -0500 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2024-03-09 14:56:52 -0500 |
commit | 7dd2857561fc7d7b63ef8b3efbaf1f2d08bd4969 (patch) | |
tree | 35ba51d57053374cdd9329ac0581735382ec3417 /README.org | |
parent | 71db3a8b4ee0ec2a205b119f7b1152126857682a (diff) | |
download | wgetpaste.el-7dd2857561fc7d7b63ef8b3efbaf1f2d08bd4969.tar.gz |
add README.org
Diffstat (limited to 'README.org')
-rw-r--r-- | README.org | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/README.org b/README.org new file mode 100644 index 0000000..7c84957 --- /dev/null +++ b/README.org @@ -0,0 +1,20 @@ +* wgetpaste.el +A small Emacs library to use wgetpaste from inside of Emacs. + +* basic use +Just run the interactive ~wgetpaste~ command in the minibuffer or via keybinding in a buffer of choice, with or without a region selected. The paste's URL will copied to the kill-ring and/or system clipboard if the upload is successful. A minibuffer notification will appear when the upload is ready! + +* customization hooks +Wgetpaste.el hooks can allow you to customize the behaviour of wgetpaste based on the state of your buffer. + +Here is an example to set the syntax highlighting to "Python" on files that have the "py" file extension. + +#+BEGIN_SRC emacs-lisp + (add-hook 'wgetpaste-before-upload-hook (lambda () + (if-let* ((file-name (buffer-file-name)) + (string= (file-name-extension file-name) "py")) + (setq-local wgetpaste-args '("--language" "Python")))) + nil t) +#+END_SRC + +Only some wgetpaste services support syntax highlighting, and some services have different names for the various syntax highlighting modes. |