Can I make zk-follow-link-at-point open in other window? #81
-
Like it says in the title -- the default behaviour is that when I click on a zk-link the target note opens in the same window. Often I work with two window next to each other and want to stay on a project note that contains my initial draft text and open the links to the relevant notes in the other window. Is there a command for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 function to zk-id-map under a memorable keybinding. My solution is to use zk-link-hint package (in this repo) along with the link-hint-aw-select package, which allows me to select which window (or frame) to open a given note in. |
Beta Was this translation helpful? Give feedback.
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:
Otherwise, I would suggest using embark, and adding the above functio…