Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text editor and text-file-based hyperlinks

Background:

It seems that some text editors and IDEs are starting to get more "browser-like" in their features. Specifically, one such feature is the ability to treat ordinary text in an open text buffer as a hyperlink to another file, resource, or even a runnable command.

Programming this as an editor plugin or macro

Since this seems like a good idea, I have started programming some scripts and editor addons to do this very kind of thing, so that the user of a text editor can open or operate on links of the following style:

href="c:/files/foobar.txt"                   (click to open file)
href="c:/files/foobar.txt" jumpto="34"       (jump to a line number)
href="c:/files/foobar.txt" find="Lorem"      (jump to 1st line containing word)
href="find_in_files://c:/files" find="Lorem" (show all matching lines)
[[find_in_files://find=Lorem;exten=*.htm*]]  (alternate syntax option)
href="redir://c:/files/feebar.txt"           (replace current edit buffer)
href="run://c:/files/foobar.jpg"             (open in default image editor)
[[run://c:/files/foobar.jpg;runwith=foo.exe]] (alternate syntax option)

Questions:

  1. Is there any kind of emerging convention for forming text-based hyperlinks?
  2. If there is a convention for this kind of thing, is there a published specification?
  3. Is there an implementation of this idea in your favorite editor/IDE?
  4. Is there an alternate pre-existing approach for this idea that does not use hyperlinks?
  5. How is this feature handled in the "grand-daddy" editors? (Vim, Emacs)

Update:

It looks like the question could have been clarified, but it turns out that Emacs Org mode is one specific example of what I was looking for that answers all of my questions.

like image 978
dreftymac Avatar asked Jan 13 '10 20:01

dreftymac


People also ask

Can you put a hyperlink in a text file?

You can add a hyperlink to a file on your computer, or to a new file that you want to create on your computer. Select the text or picture that you want to display as a hyperlink. Press Ctrl+K.

Is Notepad a text file?

You can create a text file on your computer with a text editor. An example of a text editor is Notepad, which is included with Microsoft Windows. When we refer to a "text file" we are talking about a plain text file without any text formatting (e.g., bold), images, different fonts, font sizes, etc.


1 Answers

Emacs' Org-Mode has support for all kinds of Hyperlinks.

like image 192
huaiyuan Avatar answered Oct 30 '22 00:10

huaiyuan