"Goto File" by Selection
In some programming languages which allows "include" or "import", you might reference several files in a file, and sometimes, you will need to open the referenced file while you editing the main file. You may wish to open the file in a easier fashion without navigating through several folders in the "Directory" window.
Let's take a look at an example:
You have opened a file "C:\web\webpage\sample.html", and a line in that file looks like that:
So, the location of the "client.js" is "C:\web\script\client.js". You highlight (select) the string "../script/client.js" in that line, and wish to open the file immediately, without navigating to the "C:\web\script" folder.
Here's the trick:
- Open the "Preferences" dialog
- Configure your Editplus to run in Single Instance mode (in the General category of the dialog, UNCHECK the "Allow multiple instances").
- Add a new User Tool in the "Tools/User Tools" section of the "Preferences" dialog.
- Menu text: "Goto File" (or something else you like)
- Command: the location of your EditPlus, for example, mine is "D:\Projects\EditPlus\editplus.exe" (WITHOUT quotation marks)
- Argument: "$(CurSel)" (WITH quotation marks)
- Initial directory: $(FileDir)
- Uncheck all checkboxes below
- Press "OK" to close the "Preferences" dialog.
- Try it. When you want to open a file by text selection, use the tool that we created just now.
- Open a file that references other files
- Select (highlight) the refenrece string, such as "../script/client.js" (WITHOUT quotation marks)
- Hit the tool "Goto File"
- EditPlus should open the file, located relative to the currently opened file, if it exists.
This trick is originally provided by W. Jordan