Reputation: 23719
I have 2 files:
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.
Upvotes: 24
Views: 18476
Reputation: 91
For posterity and some future seeker of this information, which I've been using for a few years in my docs.
Use: [[file+emacs:/path/to/file.php::line]]
The '+emacs' forces Emacs to open the link inside Emacs instead of some other app that handles that file extension.
Upvotes: 1
Reputation: 1944
If I understand the question right you can do it automatically with two org-mode commands:
Move the point to a line in a php file and M-x org-store-link
.
Go to an org file and C-c C-l
or M-x org-insert-link
and follow the instructions in the minibuffer.
You are done, click the link or C-c C-o
when the point is on it to open the link.
I have org-store-link
on C-c l
and org-insert-link
on the default C-c C-l
. This makes the process very convenient and fast to execute.
Have fun with org-mode.
Upvotes: 21
Reputation: 241758
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.
Upvotes: 30