summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el2
-rw-r--r--lisp/km-org.el10
2 files changed, 12 insertions, 0 deletions
diff --git a/init.el b/init.el
index 9ecdd7e..d3c7524 100644
--- a/init.el
+++ b/init.el
@@ -341,6 +341,8 @@
("o" . km/org-open-file)
("p" . km/org-open-file-at-point)
("r" . km/org-open-recent-file))
+ (bind-keys :map km/global-org-map
+ ("f" . km/org-copy-plain-file-link))
(define-key ctl-x-4-map "o" #'km/org-switch-to-buffer-other-window)
diff --git a/lisp/km-org.el b/lisp/km-org.el
index d4cc2f2..37ca829 100644
--- a/lisp/km-org.el
+++ b/lisp/km-org.el
@@ -537,6 +537,16 @@ beginning of the link."
(goto-char beg)
slurped))))
+;;;###autoload
+(defun km/org-copy-plain-file-link ()
+ (interactive)
+ (kill-new
+ (message
+ (concat "file:"
+ (abbreviate-file-name
+ (or (buffer-file-name)
+ (user-error "Buffer not visiting a file")))))))
+
;;; Export