Instant Jump to a hyperlink to find local files

Usage tips, posted by users. No questions here please.

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
drefty
Posts: 35
Joined: Mon Dec 22, 2003 3:53 pm

Instant Jump to a hyperlink to find local files

Post by drefty »

Many times it is useful to immediately jump to a different location in separate file while working in TextPad.

For example, this topic shows one situation where you may want to do this.

You can also get similar functionality by using pressing ...

Code: Select all

[ctrl+shift+G]
... on any line in a text file that has a hyperlink in it, the following lines are examples:

Code: Select all

href="c:/docs/projectFoo/documentation"
< script src="/docs/projectFoo/WebFormUtils.js" language="javascript" />
// href="c:/docs/bigHugeDocument.txt(233)"
// href="c:/docs/yetAnotherHugeDocument.asc(1233)"
## lib="c:/myscripts/python/MyPythonLibrary.py(33)"
The important thing to notice about this is ...
1) You can make a macro that inserts the current filename (but not the active line number) inside the file as an 'href style' tag;
2) You can cut and paste the output from step 1) into any other files you want
3) Including the parenthesis with line number in the href will automatically jump to that line when you use [ctrl+shift+G]
4) You don't have to use 'href=' but just make sure that the first thing that occurs on the line of text is a reference to the file you want to 'jump to'

The nice thing about this is you do not have to install any other application and you do not have to break the syntax of your source file in order to get this functionality. You can prefix the line with a comment character and the 'jump to' functionality still works!
Post Reply