1

Org mode's org-open-at-point (C-c C-o) works great for internal links, e.g.

Stuff to buy:
- <<food>> food:
  - tomato
  - potato
  - banana
- <<drinks>> drinks:
  - juice
  - tea
  - coffee

Maybe look for some more variation for [[food]]?

However, when I use org-open-at-point in [[food]], Evil mode's evil-jump-backward (C-o) does not bring me back to my original position. Org mode itself tells me in the echo area to use C-c & (org-mark-ring-goto) instead, but I would like to use evil-jump-backward to remember only a single keybinding.

Is it possible to use Evil's C-o also movements via org-open-at-point?

2 Answers 2

0

Besides @Zeta‘s answer. a less intrusive way could be:

(evil-set-command-property 'org-open-at-point :jump t)

for how it works, just inspect evil--jump-hook which is in pre-command-hook.

0

Sure. evil-jump-backward knows where to jump to via evil-set-jump. All we need to do is to call evil-set-jump before we jump in org-open-at-point. We need to advice the function for that:

(advice-add 'org-open-at-point :before 'evil-set-jump)

This makes sure that before org-open-at-point gets called, evil-set-jump gets called first, therefore saving the location. C-o will then work as intended.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.