Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Settings/Preferences, Notepad++ has an option on the MISC. tab under 'Clickable Link Settings' to the right, to Enable to open links found in the edited files. It underlines them and opens them on double-click. I've tried it with the file:/// protocol and it works, but it actually executes them according to whatever file-association I have set in Windows.

Is there a way, a protocol, or a way to "make" a (local) protocol, such that Notepad++ opens any kind of files (any extension), from these links in the document, in Notepad++ itself? (ie in another tab)

share|improve this question
    
This is quite a late response... So you don't want to change your default editor to be Notepad++, you just want to enable links that are inside Notepad++ to remain in there when you open them? –  Jon Aug 14 '13 at 15:39
    
@Jon yes, as you say! As an extra, even better if I can select which kind (protocol) of links to open internally (n++) and externally (OS). So I could select that only file:// links to open in n++. –  naxa Aug 14 '13 at 18:52
1  
I guess that would require a plugin to do that. Scanned through Directory for Notepad++ plugins but didn't spot anything like it, only the Explorer plugin which promises to open any file that is clicked in Npp. –  zagrimsan Aug 15 '13 at 9:07

1 Answer 1

up vote 1 down vote accepted

file:// is an intrinsic protocol of Windows, so if you want to ignore the "whatever file-association [is] set in Windows," i'd suggest you use a dedicated protocol, say npp://. Then add this to your registry (using the corresponding path on your system):

[HKEY_CLASSES_ROOT\NPP]
@="URL: NotePad++ Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\NPP\DefaultIcon]
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\""

[HKEY_CLASSES_ROOT\NPP\shell]

[HKEY_CLASSES_ROOT\NPP\shell\open]

[HKEY_CLASSES_ROOT\NPP\shell\open\command]
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""
share|improve this answer
1  
superb tip & funny results :D. depending on the path separator and number of directories I use, N++/windows behaves very differently (sometimes opening a folder in explorer?!), most combinations not working. Also I escaped \"%1\" in the .reg file. –  naxa Sep 5 '13 at 21:15
    
Point taken. :"> I've corrected it myself now, but i think you could've done it yourself, considering it's a bugfix. ; As for the inconsistent results, the programmer in me would like to suggest that you make a test app that highlights whatever it is that windows is passing to it as args[0]... :D –  C.B. Sep 5 '13 at 23:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.