Previous: Remember, Up: Capture


9.2 Attachments

It is often useful to associate reference material with an outline node/task. Small chunks of plain text can simply be stored in the subtree of a project. Hyperlinks (see Hyperlinks) can be used to establish associations with files that live elsewhere on your computer or in the cloud, like emails or source code files belonging to a project. Another method is attachments, which are files located in a directory belonging to an outline node. Org uses directories named by the unique ID of each entry. These directories are located in the data directory which lives in the same directory where your org-file lives1. If you initialize this directory with git-init, Org will automatically commit changes when it sees them. The attachment system has been contributed to Org by John Wiegley.

The following commands deal with attachments.

C-c C-a
The dispatcher for commands related to the attachment system. After these keys, a list of commands is displayed and you need to press an additional key to select a command:
a
Select a file and move it into the task's attachment directory. The file will be copied, moved, or linked, depending on org-attach-method. Note that hard links are not supported on all systems.


c/m/l
Attach a file using the copy/move/link method. Note that hard links are not supported on all systems.


n
Create a new attachment as an Emacs buffer.


z
Synchronize the current task with its attachment directory, in case you added attachments yourself.


o
Open current task's attachment. If there are more than one, prompt for a file name first. Opening will follow the rules set by org-file-apps. For more details, see the information on following hyperlings (see Handling links).


O
Also open the attachment, but force opening the file in Emacs.


f
Open the current task's attachment directory.


F
Also open the directory, but force using dired in Emacs.


d
Select and delete a single attachment.


D
Delete all of a task's attachments. A safer way is to open the directory in dired and delete from there.

Footnotes

[1] If you move entries or Org-files from one directory to the next, you may want to configure org-attach-directory to contain an absolute path.