Skip to content

Can I make zk-follow-link-at-point open in other window? #81

Answered by localauthor
maasdorp asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! The question is: do you always want to open notes in 'other-window'?

If so, the most expedient way would be to define a new function and add it as the action property of the zk-link button type.

To do so, add the following to your config or init file:

(defun zk-follow-link-other-window (&optional id)
  "Open note that corresponds with the zk ID at point."
  (interactive)
  (let ((id (or (zk--id-at-point)
                id)))
    (if id
        (find-file-other-window (zk--parse-id 'file-path id))
      (error "No zk-link at point"))))

(button-type-put 'zk-link
                 'action 'zk-follow-link-other-window)

Otherwise, I would suggest using embark, and adding the above functio…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maasdorp
Comment options

Answer selected by maasdorp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants