46
  1. Is there a way to link to specific topic (*) in a different org-file?
  2. How can I quickly find and copy the relative path from the current org-file to the file that I want to link to?

Probably both straight forward but I couldn't figure it out. Thanks your help.

cataclysmic
  • 797
  • 1
  • 5
  • 13

3 Answers3

45

For #2, first you'll want to add a couple of keybindings to your init file (these are the suggested keys in the Org manual) -

(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c C-l") 'org-insert-link)

then you can hit C-c l somewhere in or on the item you want to link to, then C-c C-l where you want to place the link. It'll ask you to confirm the location and then enter a link name - you can just hit enter to accept the defaults. It will create a link like [[file:foo.org::*bar][link-name]], which displays as link-name.

See http://orgmode.org/manual/Handling-links.html for more details.

Brian Burns
  • 1,577
  • 14
  • 15
13
  1. you can reference this topic http://orgmode.org/manual/External-links.html#External-links

    file:projects.org::some words text search in Org file

    file:projects.org::*task title heading search in Org file

  2. sorry, I don't know what you mean.

NickD
  • 27,023
  • 3
  • 23
  • 42
driftcrow
  • 311
  • 1
  • 5
  • 1
    Thank you for the reply. With number 2 I mean how can I easily get the path to the file that I want to link to paste it into the link. – cataclysmic Jan 17 '16 at 16:10
1

For 1, insert a link to a header (topic), inspired by @BrianBurns' answer, I found a more convenient solution:

  1. Go to the header of org-file, that you want to link to, M-x org-store-link (SPC n l)
  2. Go to the position, where you want to insert the link to the above mentioned header, M-X org-insert-last-stored-link (SPC m l S)

The bindings are from doom/emacs.

Yu Shen
  • 451
  • 4
  • 15