<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Plugin request: insert relative path]]></title><description><![CDATA[<p dir="auto">I’m using Notepad++ to maintain a (huge) website with thousands of internal links. And yes, I know I’m a dinosaur for not switching to Wordpress or something - but I want to have total control about every aspect of the site and total independence regarding software and servers.</p>
<p dir="auto">Anyway, while everything works just fine once I learned how to use regex (quite a learning curve…), there’s that one thing that would be a huge time-saver: <strong>a plug-in to create internal, relative links</strong>. Because currently it is an awful lot of clicking around, plus guesswork and/or debugging:</p>
<ul>
<li>I have to search for the target file in a separate file browser</li>
<li>I then have to select and copy the file name (or alternatively the absolute path name, SHIFT+RMB in Windows)</li>
<li>Go back to Notepad++</li>
<li>Find where I have left and paste</li>
<li>Modify the path to be relative to the file I’m editing (which isn’t intuitive at all and requires very good knowledge of the structure of the site I’m editing)</li>
<li>Try out every single manually created link and fix the inevitable typos</li>
</ul>
<p dir="auto">I imagine the path insert plugin to work as follows:</p>
<ul>
<li>When invoked (via RMB menu or shortcut), it opens a file browser</li>
<li>I select one file, and the relative path from the current document to that file gets inserted at the cursor position. That’s it.</li>
</ul>
<p dir="auto">I’m not a developer but that sounds pretty doable for someone who’s into plug-ins and UIs. I wouldn’t want to create the complete HTML &lt;a&gt; or &lt;img&gt; tags, but just the relative path, without quotes or anything (for maximum compatibility with just every markup that needs a relative path).</p>
<p dir="auto">Useful extra options:</p>
<ul>
<li>Basic setting “Always open file browser from current editor window location” vs. “Open file browser from recalled last location” (the latter option will work better if all or most linked images are stored in one specific “images” dir, the first one is for linking “wildly” to files that are anywhere else on the server) --&gt; very useful</li>
<li>Show selection of “Currently opened files” or “Recently opened files” alternatively or additionally to file browser --&gt; very useful</li>
<li>Allow multiple file selection for multiple path insertion (helpful for image galleries and such) --&gt; somewhat useful</li>
<li>Basic setting with a check box and/or text field “Use server root” / “Define server root” (a directory from where -optionally!- the link is created with leading “/”) --&gt; for special cases</li>
<li>Any other suggestions?</li>
</ul>
<p dir="auto">I would love to receive some feeback on this request. Perhaps I’m not alone with this issue.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20120/plugin-request-insert-relative-path</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 15:03:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20120.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Oct 2020 12:07:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Plugin request: insert relative path on Mon, 25 Aug 2025 22:22:33 GMT]]></title><description><![CDATA[<p dir="auto">Has anyone here found how to open those relative path links from within the Notepad++ file, in their default app ?</p>
<p dir="auto">That would make the solutions listed here even more useful IMO; one could have for instance have the documentation of a project in simple text files.</p>
<p dir="auto">Opening the links at either double-click (better, &amp; underlined) or some other action.<br />
I’ve requested the feature on github <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16942" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16942</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/103030</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/103030</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 25 Aug 2025 22:22:33 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Sun, 17 Jan 2021 14:19:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bernd-schneider" aria-label="Profile: Bernd-Schneider">@<bdi>Bernd-Schneider</bdi></a><br />
You could use tag lookup plugin.<br />
With ctags generate tags file where every file name is a tag. Then just lookup the filename regardless of the relative path.</p>
<p dir="auto">Usefulness depends on how you name the files. If you have 1000 file named page001.html then this approach would not help, but if most of your file names are rather unique then it should be the easiest way to go. Few duplication are not an issue because you could select them manually.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61951</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61951</guid><dc:creator><![CDATA[gstavi]]></dc:creator><pubDate>Sun, 17 Jan 2021 14:19:27 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Sat, 16 Jan 2021 19:22:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> Sorry for the late reply, just tested it, works like a charm. Thanks a lot!<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/troshindv" aria-label="Profile: TroshinDV">@<bdi>TroshinDV</bdi></a> May try it out later. Having a pop-up is intriguing so I don’t need to move to the Explorer window.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61942</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61942</guid><dc:creator><![CDATA[Bernd Schneider]]></dc:creator><pubDate>Sat, 16 Jan 2021 19:22:26 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Sat, 16 Jan 2021 15:57:43 GMT]]></title><description><![CDATA[<p dir="auto">So much other stuff to take care of, I forgot about this topic. Thanks for your replies, I will check out the options!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61923</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61923</guid><dc:creator><![CDATA[Bernd Schneider]]></dc:creator><pubDate>Sat, 16 Jan 2021 15:57:43 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Fri, 09 Oct 2020 07:35:45 GMT]]></title><description><![CDATA[<p dir="auto">I implemented a similar task in javascript using a [jN](<a href="https://github.com/sieukrem/jn-npp-plugin" rel="nofollow ugc">Адрес ссылки</a>) plugin.<br />
The script that implements this functionality is located in the repository:<br />
<a href="https://github.com/trdm/jn-npp-scripts" rel="nofollow ugc">https://github.com/trdm/jn-npp-scripts</a><br />
Scripts involved: Intell.js, IntellHtml.js.<br />
<img src="https://raw.githubusercontent.com/trdm/jn-npp-scripts/master/Doc/pi2020-10_09_1.gif" alt="alt text" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/58404</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/58404</guid><dc:creator><![CDATA[TroshinDV]]></dc:creator><pubDate>Fri, 09 Oct 2020 07:35:45 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Fri, 09 Oct 2020 08:11:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bernd-schneider" aria-label="Profile: Bernd-Schneider">@<bdi>Bernd-Schneider</bdi></a></p>
<p dir="auto">You could use the Notepad++ <em>Explorer</em> plugin as a GUI to select the file whose relative path you want to paste to your current document. This plugin is also able to cooperate with the <em>NppExec</em> plugin and execute scripts written in the <em>NppExec</em> scripting language. To get the relative path you want, there is a Windows API. To call it from a script you need the <em>WinApiExec</em> commandline tool.</p>
<p dir="auto">Follow these steps:</p>
<ol>
<li>Download the <em>WinApiExec</em> tool from <a href="https://rammichael.com/winapiexec" rel="nofollow ugc">&gt;&gt; here &lt;&lt;</a> and store it into a folder of your choice. Maybe you want to add this folder to your system’s <em>PATH</em> variable. This way you avoid to enter the full path to the tool in the script you will create later on.</li>
<li>Go to <code>(menu) Plugins -&gt; Plugins Admin</code> and install the <em>NppExec</em> plugin.</li>
<li>After Notepad++ has been restarted install the <em>Explorer</em> plugin. <strong>Please note:</strong> This order might be important!</li>
<li>After Notepad++ has been restarted go to <code>(menu) Plugins -&gt; Explorer -&gt; Explorer Options</code> and ensure that the content of the <code>Path of Scripts</code> input field points to a valid folder in your user profile. If this is not the case click the <code>...</code> button and select an appropriate folder of your choice. Also ensure that the content of the <code>DLL Name</code> input field is set to <code>NppExec.dll</code>. Then close the dialog by clicking the <code>OK</code> button.</li>
<li>Go to <code>(menu) Plugins -&gt; Explorer</code> and tick the <code>Explorer ...</code> menu entry. The <em>Explorer</em> plugin panel should become visible.</li>
<li>Navigate to an arbitrary folder (it doesn’t matter if you do that in the upper folder-only tree or in the lower folder-plus-files list) and right-click some item.</li>
<li>In the context menu popping up go to <code>NppExec script(s) -&gt; Go to script folder</code>. The <em>Explorer</em> plugin updates its panel and navigates to the folder you might have been set in step 4.</li>
<li>Right-click at some empty space in the lower folder-plus-files list and click on <code>New File</code> in the context menu popping up. This will show a dialog box where you can enter the name of the new file. Enter <code>PasteRelativePath.exec</code>. <strong>Please note:</strong> The file extension <code>.exec</code> is important. After clicking the <code>OK</code> button a new empty file is created on disk and it’s opened in Notepad++.</li>
<li>Copy and paste the following script code to this file and save it:</li>
</ol>
<pre><code class="language-Z">//Explorer: NppExec.dll EXP_FULL_PATH[0]
// ------------------------------------------------------------------
// NOTE: The first line is in every script necessary
// Format of the first line:
//   //Explorer:          = Identification for Explorer support
//   NppExec.dll          = NppExec DLL identification
//   EXP_FULL_PATH[0] ... = Exec arguments - [0]=First selected file
// ------------------------------------------------------------------
// Example for selected files in file list of Explorer:
// - C:\Folder1\Folder2\Filename1.Ext
// - C:\Folder1\Folder2\Filename2.Ext
// ------------------------------------------------------------------
// EXP_FULL_PATH[1]       = C:\Folder1\Folder2\Filename2.Ext
// EXP_ROOT_PATH[0]       = C:
// EXP_PARENT_FULL_DIR[0] = C:\Folder1\Folder2
// EXP_PARENT_DIR[0]      = Folder2
// EXP_FULL_FILE[1]       = Filename2.Ext
// EXP_FILE_NAME[0]       = Filename1
// EXP_FILE_EXT[0]        = Ext

// NppExec script body:
npp_console keep

// Get relative file path and put it to clipboard
"winapiexec.exe" shlwapi.dll@PathRelativePathToW ( GlobalLock ( GlobalAlloc 0x0042 1024 ) ) "$(FULL_CURRENT_PATH)" 128 "$(ARGV[1])" 128 , GlobalUnlock $$:5 , u@OpenClipboard 0 , u@SetClipboardData 13 $$:5 , u@CloseClipboard

// Convert backslashes to slashes
set local $(RelPath) ~ strreplace $(CLIPBOARD_TEXT) "\" "/"
sel_settext $(RelPath)
</code></pre>
<p dir="auto"><strong>Please note:</strong> If you haven’t added the folder where <code>winapiexec.exe</code> is stored to your system’s <em>PATH</em> variable you have to provide its full path in the script above.</p>
<p dir="auto">Now open one of your website’s files and place the cursor at some place where you want to insert the relative path of another file. Then go to <em>Explorer</em> plugin’s panel, navigate to that other file and right-click it. In the context menu popping up click on <code>NppExec script(s) -&gt; PasteRelativePath.exec</code> (this is the script you created in step 9.). The relative path of the selected file should be inserted at the cursor position.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/58396</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/58396</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Fri, 09 Oct 2020 08:11:05 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Thu, 08 Oct 2020 15:07:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bernd-schneider" aria-label="Profile: Bernd-Schneider">@<bdi>Bernd-Schneider</bdi></a></p>
<p dir="auto">I think by “RMB” you mean “Right Mouse Button” and thus you mean the right-click context menu?<br />
If so, then I don’t think scripting could easily give you the ability to insert things there.</p>
<p dir="auto">What I do with scripting in such situations is to have it open a new “scratch” file, put data there, allow user to make a choice, and then do an action based upon that choice.<br />
Sort of a poor-man’s-user-interface.<br />
It works.  Not super glitzy, but it works.</p>
<p dir="auto">The choice as I imagine it for you, would be to select one of a number of listed file, then do your action by inserting the appropriate data either directly in the document (as you said) or maybe into the clipboard if that is helpful.</p>
<p dir="auto">If the above seems reasonable, I could put a mock-up together that would illustrate how it could be accomplished.</p>
<p dir="auto">One thing I’m curious about:  What kind of relative path are you looking for?<br />
It obviously has to be “relative” to something. :-)<br />
But how is that relative nature conveyed to something like what we’re discussing?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/58391</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/58391</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 08 Oct 2020 15:07:34 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Thu, 08 Oct 2020 12:55:03 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your reply.</p>
<p dir="auto">Since I’ve never created a plugin before, I’m not sure how much can be accomplished with simple scripting.</p>
<p dir="auto">Would it be possible, with a script, to insert the list of currently/recently opened files into the RMB menu, so I can select one to create a relative link from? That would help with files that I know in advance I am likely to link to. Everything more powerful, I guess, would require a built-in file browser.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/58384</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/58384</guid><dc:creator><![CDATA[Bernd Schneider]]></dc:creator><pubDate>Thu, 08 Oct 2020 12:55:03 GMT</pubDate></item><item><title><![CDATA[Reply to Plugin request: insert relative path on Thu, 08 Oct 2020 12:38:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bernd-schneider" aria-label="Profile: Bernd-Schneider">@<bdi>Bernd-Schneider</bdi></a></p>
<p dir="auto">So for maximal “professionalism”, the plugin is the way to go.<br />
But it is likely a great deal of work.</p>
<p dir="auto">Have you considered using a scripting language plugin to do something “quick and dirty”, yet still meet your basic need?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/58382</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/58382</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 08 Oct 2020 12:38:12 GMT</pubDate></item></channel></rss>