Use Org-Mode Links for Absolutely Anything10 Aug 2014, by Artur Malabarba.
The Power of Org-links post series
- Use Org-Mode Links for Absolutely Anything
- Embedding Youtube videos with org-mode links
One little-know feature of org-mode is that you can define new types
of links with the aptly named
org-add-link-type. The applications of
this virtue are many. One might, for instance, write links which
search an entire code base for an expression.
(org-add-link-type "grep" 'endless/follow-grep-link) (defun endless/follow-grep-link (regexp) "Run `rgrep' with REGEXP as argument." (grep-compute-defaults) (rgrep regexp "*" (expand-file-name "./")))
Then, when you click on something like the following link in an
org-mode buffer, you'll be taken to a list of results.
** TODO Refactor [[grep:OldClassName][OldClassName]] into NewClassName
LINK header arguments
As /u/blue1_ points out, for links that are simple URL substitutions
you can also use
#+LINK: isbn http://www.amazon.com/dp/%s
For another use case, the following code defines links which search your headlines for specific tags.
(org-add-link-type "tag" 'endless/follow-tag-link) (defun endless/follow-tag-link (tag) "Display a list of TODO headlines with tag TAG. With prefix argument, also display headlines without a TODO keyword." (org-tags-view (null current-prefix-arg) tag))
Then, merely write your links as