Copy links from image
I'm working with directories full of images, which are photographs of documents in an archive. I'm writing org files with notes on the content of these, and I would like to make it quicker and easier to browse the images (eg with image-dired) and copy links into the org-mode file alongside my notes.
My working setup looks like this:
My questions are:
Here is a little code to make working with images easier. Just copy it into your *scratch*
buffer and run Mx eval-buffer
.
(defun my-next-image ()
(interactive)
(save-excursion
(with-current-buffer "*image-dired*"
(image-dired-forward-image)
(image-dired-display-thumbnail-original-image))))
(defun my-prev-image ()
(interactive)
(save-excursion
(with-current-buffer "*image-dired*"
(image-dired-backward-image)
(image-dired-display-thumbnail-original-image))))
(defun my-insert-current-image-path ()
(interactive)
(insert
(concat
"[["
(save-excursion
(with-current-buffer "*image-dired*"
(image-dired-original-file-name)))
"]]")))
(define-key org-mode-map (kbd "<f9> n") 'my-next-image)
(define-key org-mode-map (kbd "<f9> p") 'my-prev-image)
(define-key org-mode-map (kbd "<f9> i") 'my-insert-current-image-path)
Press F9 n
to switch to the next image while in org mode, press F9 i
to insert a link to the current image. Rebind keys to your liking.
下一篇: 复制图片中的链接