emacsorg-mode

How to make a link to external file line in Emacs org-mode


I have 2 files:

  1. php file with code
  2. org file with docs

How to create a link to a line in php file from org file? So clicking it will move the cursor to the appropriate line in php file.


Solution

  • Use this notation in the org mode to create a link:

    [[/path/to/file.php::line][string-to-display]]
    

    If you want the file name to be displayed, use just

    [[/path/to/file.php::line]]
    

    See Hyperlinks in the Org mode Info page for details and other ways to specify links.