Org-mode: Go back to previous location after opening links

Published on Sep 5, 2021, by Junji Zhi

The function you are looking for is:

(org-mark-ring-goto)

I like to bind it the same as pop-tag-mark as in other modes, so that pressing Ctrl + - acts like going back to the previous location after you go to a definition.

For example:

(defun jz/org-mode-hook ()
  (local-set-key (kbd "C--") 'org-mark-ring-goto))
    
(add-hook 'org-mode-hook 'jz/org-mode-hook)