add obsidian uri handler
This commit is contained in:
parent
1b85376046
commit
ff69dd3500
19
init.el
19
init.el
|
@ -875,6 +875,9 @@ position between last non-whitespace and `end-of-line'."
|
|||
(goto-char 0)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; disable toolbar in gui
|
||||
|
||||
(tool-bar-mode -1)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -1385,6 +1388,22 @@ position between last non-whitespace and `end-of-line'."
|
|||
(funcall helm-fun origfun start end collection predicate)
|
||||
(setq helm-crm-default-separator tcrmds))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; obsidian link handler from https://forum.obsidian.md/t/emacs-on-macos-org-mode-link-handler-for-obsidian-links/19230
|
||||
|
||||
;; obsidan link handling for obsidian:// links
|
||||
(defun org-obsidian-link-open (slash-message-id)
|
||||
"Handler for org-link-set-parameters that opens a obsidian:// link in obsidian"
|
||||
;; remove any / at the start of slash-message-id to create real note-id
|
||||
(let ((message-id
|
||||
(replace-regexp-in-string (rx bos (* "/"))
|
||||
""
|
||||
slash-message-id)))
|
||||
(async-shell-command (concat "/c/Users/mcros/AppData/Local/Programs/Obsidian/Obsidian.exe \"obsidian://" message-id "\""))))
|
||||
|
||||
;; on obsdian://aoeu link, this will call handler with //aoeu
|
||||
(org-link-set-parameters "obsidian" :follow #'org-obsidian-link-open)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ui tuning
|
||||
|
||||
|
|
Reference in a new issue