Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Links between org files

Tags:

emacs

org-mode

Say I have two org files, file1.org and file2.org on disk (let's assume they are in the same directory). How can create a link on file1.org to file2.org?

Once I have the link on file1.org, let's assume I have cursor (point) sitting on that link. How can I tell Emacs to show me the corresponding file?

Finally, what if I want to create a link to a specific item of file2.org ?

like image 975
Amelio Vazquez-Reina Avatar asked Jan 31 '14 14:01

Amelio Vazquez-Reina


People also ask

How do you add a link in Org mode?

Links in Org are plain text, and you can type or paste them straight into the buffer. By using this command, the links are automatically enclosed in double brackets, and you will be asked for the optional descriptive text.

How do I create a link to a file?

Create a hyperlink to a file on your computerSelect the text or picture that you want to display as a hyperlink. Press Ctrl+K. Under Link to, do one of the following: To link to an existing file, click Existing File or Web Page under Link to, and then find the file in the Look in list or the Current Folder list.

What are org mode files?

Org Mode (also: org-mode; /ˈɔːrɡ moʊd/) is a document editing, formatting, and organizing mode, designed for notes, planning, and authoring within the free software text editor Emacs.

What is org capture?

Capture lets you quickly store notes with little interruption of your work flow. Org's method for capturing new items is heavily inspired by John Wiegley's excellent Remember package. Setting up capture. Using capture. Capture templates.


2 Answers

Use the C-c C-l shortcut to create link and use the syntax

file:./file2.org

and use C-c C-o with cursor on link to visit that link.

To link to a specific item, use

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

the doc: http://orgmode.org/org.html#External-links

you can even search for words:

file:projects.org::some words
like image 65
Ehvince Avatar answered Nov 15 '22 19:11

Ehvince


I like to use org-id-copy. It's kind of a precision instrument compared to the other methods that give you troubles when there are many candidates.

After the call, current heading will have ID set in its property drawer. The ID looks like 5d76eafc-94f6-47b1-ae4c-a7e917986fd1 and it's in your kill ring now. You can insert with C-c C-l to make it look like

[[id:5d76eafc-94f6-47b1-ae4c-a7e917986fd1][link]]

You can see a sample usage within one file at https://gist.github.com/abo-abo/6040382 , but it also works across multiple files.

like image 21
abo-abo Avatar answered Nov 15 '22 20:11

abo-abo