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.
The main function is org-store-link , called with M-x org-store-link . Because of its importance, we suggest to bind it to a widely available key (see Activation). It stores a link to the current location. The link is stored for later insertion into an Org buffer—see below.
Emacs does not actually understand you are editing an Org document, yet. To enable Org mode on your current document, type M-x org-mode which will enable the Org mode on the current document. Those are minuses, not underscores.
Emacs has included Org Mode as a major mode by default since 2006. Bastien Guerry is the current maintainer, in cooperation with an active development community. Since its success in Emacs, some other systems now provide functions to work with org files.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With