{"id":13862285,"url":"https://github.com/unhammer/org-rich-yank","last_synced_at":"2025-04-06T15:13:29.427Z","repository":{"id":56313376,"uuid":"120900916","full_name":"unhammer/org-rich-yank","owner":"unhammer","description":"📋 Rich text clipboard for org-mode: Paste as a #+BEGIN_SRC block of correct mode, with link to where it came from","archived":false,"fork":false,"pushed_at":"2025-03-04T14:06:47.000Z","size":413,"stargazers_count":92,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T13:11:07.506Z","etag":null,"topics":["clipboard","emacs","org-mode","paste","rich-text","yank"],"latest_commit_sha":null,"homepage":"https://melpa.org/#/org-rich-yank","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unhammer.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-09T12:04:46.000Z","updated_at":"2025-03-04T14:06:51.000Z","dependencies_parsed_at":"2025-02-18T21:01:47.651Z","dependency_job_id":"a0c01a8e-8f20-47d6-ab53-766f81d83872","html_url":"https://github.com/unhammer/org-rich-yank","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhammer%2Forg-rich-yank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhammer%2Forg-rich-yank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhammer%2Forg-rich-yank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhammer%2Forg-rich-yank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unhammer","download_url":"https://codeload.github.com/unhammer/org-rich-yank/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500469,"owners_count":20948880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clipboard","emacs","org-mode","paste","rich-text","yank"],"created_at":"2024-08-05T06:01:41.172Z","updated_at":"2025-04-06T15:13:29.405Z","avatar_url":"https://github.com/unhammer.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"#+TITLE: org-rich-yank\n\n[[https://melpa.org/#/org-rich-yank][https://melpa.org/packages/org-rich-yank-badge.svg]]\n\nDo you often yank source code into your org files, manually\nsurrounding it in =#+BEGIN_SRC= blocks? This package will give you a\nnew way of pasting that automatically surrounds the snippet in blocks,\nmarked with the major mode of where the code came from, and adds a\nlink to the source file after the block.\n\n#+ATTR_HTML: :alt org-rich-yank demo\n[[file:org-rich-yank.gif][file:org-rich-yank.gif]]\n\n* Installation\n\n** MELPA\nIf you use [[https://melpa.org/][MELPA]], you can just do =M-x list-packages=, find\n=org-rich-yank= in the list and hit =i x=.\n\n** Manual\nJust put =org-rich-yank.el= somewhere in =load-path=.\n\n\n* Usage\n\n** Manual, loading on startup:\n\nTo use, require and bind whatever keys you prefer to the\ninteractive function:\n\n#+BEGIN_SRC emacs-lisp\n(require 'org-rich-yank)\n(define-key org-mode-map (kbd \"C-M-y\") #'org-rich-yank)\n#+END_SRC\n\n** With use-package, enabled after org:\n\nIf you prefer =use-package=, the above settings would be:\n\n#+BEGIN_SRC emacs-lisp\n(use-package org-rich-yank\n  :ensure t\n  :demand t\n  :bind (:map org-mode-map\n              (\"C-M-y\" . org-rich-yank)))\n#+END_SRC\n\nThe =:demand t= in there is because we never know when the user will\nhit =C-M-y=, so we always have to store the current buffer on\nkills. You can remove the =:demand t= and have lazy/deferred loading,\nbut then the first time you hit =C-M-y= after startup, you'll get a\nmessage that you have to kill the selection again.\n\n* Configuration\n\n** Image support\n\nIf you have =org-download= installed and you copy image contents,\n=org-rich-yank= will defer to =org-download-clipboard=. You can turn\nthis feature off by setting =org-rich-yank-download-image= to =nil=.\n\n** Changing the link/block format\n\nIf you want to change how the source block or link is formatted, you\ncan do so by setting =org-rich-yank-format-paste= to a function. For\nexample, links to local files might be useful in your org document but\nnot so useful in exported content, so you may want to make such a link\na /comment/ line.\n\n#+begin_src emacs-lisp :tangle no\n  (defun my-org-rich-yank-format-paste (language contents link)\n    \"Based on `org-rich-yank--format-paste-default'.\"\n    (format \"#+BEGIN_SRC %s\\n%s\\n#+END_SRC\\n#+comment: %s\"\n            language\n            (org-rich-yank--trim-nl contents)\n            link))\n  (customize-set-variable 'org-rich-yank-format-paste #'my-org-rich-yank-format-paste)\n#+end_src\n\nConfiguring the variable as above results in the following content being pasted:\n\n#+begin_example\n  ,#+BEGIN_SRC emacs-lisp\n  ;; URL: https://github.com/unhammer/org-rich-yank\n  ;; Package-Requires: ((emacs \"24.4\"))\n  ;; Keywords: convenience, hypermedia, org\n  ,#+END_SRC\n  ,#+comment: [[file:~/src/org-rich-yank/org-rich-yank.el]]\n#+end_example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funhammer%2Forg-rich-yank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funhammer%2Forg-rich-yank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funhammer%2Forg-rich-yank/lists"}