Reputation: 912
I'm using org-files in emacs for documentation. Is there a possibility to define an alias for a folder inside an org-file? Motivation: Say I have several file-links which belong to the same folder. If I move the files I have to change all this links. It would be easier to change only one folder-alias. Is this possible?
Upvotes: 3
Views: 1534
Reputation: 251
In your init.el or .emacs file, you can define the variable org-link-abbrev-alist
by doing the following:
(setq org-link-abbrev-alist
'(("directory1" . "c:/Path/") ;; Windows
("directory2" . "~/Path/"))) ;; Linux/OSX
Alternatively, if you don't want these settings to apply to all your org-mode files, you can just put the following in the header of the org-mode files you DO want the settings to apply to:
#+LINK: directory1 c:/Path/
#+LINK: directory2 ~/Path/
To then link to these files from within your org-mode file(s), use the following:
[[directory1:file1.txt][file1.txt]]
If / when you move the directory, just change the abbreviations. Additional information in the Org-mode Manual: Link abbreviations
Upvotes: 6