:attach now inserts link if in visual mode
This commit is contained in:
parent
4adee58ce9
commit
89c7c77c1d
1 changed files with 4 additions and 1 deletions
|
@ -20,7 +20,10 @@
|
|||
(cond ((string-match-p "^https?://" link)
|
||||
(url-copy-file link new-path))
|
||||
(t (copy-file link new-path)))
|
||||
(insert (format "[[./%s]]" (f-relative new-path default-directory))))))
|
||||
(let ((relpath (f-relative new-path default-directory)))
|
||||
(if (evil-visual-state-p)
|
||||
(org-insert-link nil (format "./%s" relpath) (buffer-substring-no-properties (region-beginning) (region-end)))
|
||||
(insert (format "[[./%s]]" relpath)))))))
|
||||
|
||||
;;;###autoload (autoload 'narf:org-attachment-list "defuns-org-attach" nil t)
|
||||
(evil-define-command narf:org-attachment-list (&optional bang)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue