"Goto File" by Selection

From EditPlus Wiki
Revision as of 20:46, 8 February 2006 by 203.162.27.86 (Talk)

Jump to: navigation, search

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.

Purpose

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:

<script language="javascript" src="../script/client.js"></script>

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.

Solution

Deprecated: Nowadays, from EditPlus 2.20 build 236 on, you can use File Menu/Other/Open Selection command to do things discussed in this topic, there's no need to use this trick any more. (However, the author has not provided a button to do this yet.)

Here's the trick:

  1. Open the "Preferences" dialog
  2. Configure your Editplus to run in Single Instance mode (in the General category of the dialog, UNCHECK the "Allow multiple instances").
  3. Add a new User Tool in the "Tools/User Tools" section of the "Preferences" dialog.
    1. Menu text: "Goto File" (or something else you like)
    2. Command: the location of your EditPlus, for example, mine is "D:\Projects\EditPlus\editplus.exe" (WITHOUT quotation marks). For long directory and file names, use "dos-notation": "C:\progra~1\EditPl~1\editplus.exe"
    3. Argument: "$(CurSel)" (WITH quotation marks)
    4. Initial directory: $(FileDir)
    5. Uncheck all checkboxes below
  4. Press "OK" to close the "Preferences" dialog.
  5. Try it. When you want to open a file by text selection, use the tool that we created just now.

Usage

  1. Open a file that references other files
  2. Select (highlight) the refenrece string, such as "../script/client.js" (WITHOUT quotation marks)
  3. Hit the tool "Goto File"
  4. EditPlus should open the file, located relative to the currently opened file, if it exists.

Go Further! For Programmers (NOT deprecated yet)

For C++, C#, Java programmers, they are likely to save their classes, interfaces in forms like these: CMyClassName.cpp, MyClassName.cs, MyInterface.Java. Here we go further to help our programming a little easier. With the tool below, we can quickly switch/open/create files of the same type in the same folder.

  1. Do as the Solution section says in this trick: Configure your Editplus to run in Single Instance mode, add a new User Tool...Everything is the same except the Argument: "$(CurSel).$(FileExt)" (WITH quotation marks, NOTICE we should append ".$(FileExt)" after the "current selection" here)
  2. Try it. When you want to open a file by text selection, use the tool that we created just now.
    1. First we open a file like "CMyClass.cpp",
    2. Select "CMyAnotherClass", If the "CMyAnotherClass.cpp" file is in the same folder as the active file, you can immediately swtich to it or open it. We only select "CMyAnotherClass" in this example, however, the corresponding CPP file is opened--it is the magic of "$(FileExt)", which makes EditPlus attempt to open a file with the same extension name as the active file.
    3. You can also quickly create a file in "$(CurSel).$(FileExt)" format by selecting something and lauching this tool.
  3. You can also explicitly set "$(FileExt)" as "cpp" or "cs" regardless the current active file extension

This trick is originally provided by W. Jordan

ambien adipex xanax xenical cialis valium fioricet tramadol carisoprodol hydrocodone ultram vicodin buy viagra ambien adipex tramadol buy ambien buy adipex buy xanax buy phentermine buy viagra buy xenical cialis valium fioricet tramadol carisoprodol buy soma hydrocodone ultram vicodin meridia alprazolam levitra didrex diazepam propecia zoloft lipitor buy viagra buy phentermine buy ambien buy adipex buy xenical buy xanax buy cialis buy valium buy fioricet buy tramadol buy carisoprodol buy soma buy hydrocodone ultram vicodin meridia alprazolam levitra didrex diazepam propecia zoloft lipitor phentermine ambien xanax phentermine viagra ambien adipex xanax xenical buy cialis buy valium buy fioricet buy tramadol buy carisoprodol buy hydrocodone buy ambien buy adipex xenical cialis valium fioricet tramadol carisoprodol hydrocodone buy propecia free ringtones nextel ringtones viagra viagra buy phentermine ambien adipex xanax xenical cialis valium fioricet tramadol carisoprodol buy soma hydrocodone ultram levitra didrex meridia alprazolam vicodin diazepam zoloft lipitor buy viagra buy ambien buy adipex buy xanax buy xenical buy cialis buy valium buy fioricet buy tramadol buy carisoprodol buy hydrocodone buy ambien buy adipex buy xanax buy xenical buy cialis buy valium buy ambien buy adipex buy ambien buy xanax buy xenical buy cialis buy valium buy fioricet buy tramadol buy carisoprodol buy hydrocodone buy phentermine buy viagra didrex meridia buy viagra phentermine ambien adipex xanax xenical cialis buy phentermine buy ambien buy adipex buy xanax buy xenical buy cialis buy valium buy tramadol buy hydrocodone ambien adipex buy fioricet buy carisoprodol meridia alprazolam ultram levitra didrex phentermine xanax cialis xenical vicodin propecia lipitor zoloft valium fioricet diazepam hydrocodone carisoprodol tramadol buy phentermine buy ambien buy adipex buy xanax buy xenical buy cialis buy valium buy fioricet buy tramadol phentermine buy carisoprodol buy hydrocodone adipex cialis ambien xanax xenical ultram vicodin meridia alprazolam levitra didrex diazepam propecia lipitor zoloft valium fioricet carisoprodol hydrocodone tramadol buy phentermine buy ambien buy xanax buy adipex buy xenical buy cialis buy valium buy fioricet buy viagra buy ambien buy adipex buy xenical buy xanax hydrocodone buy hydrocodone xanax ultram vicodin meridia alprazolam levitra didrex diazepam propecia zoloft lipitor buy viagra ambien buy ambien buy adipex adipex buy xanax xenical valium fioricet buy tramadol carisoprodol buy soma buy tramadol buy carisoprodol buy hydrocodone ambien didrex buy ambien order viagra order phentermine buy adipex buy phentermine buy xanax buy xenical buy valium buy tramadol buy fioricet buy carisoprodol buy cialis buy hydrocodone buy viagra buy phentermine buy ambien buy adipex buy xanax buy xenical buy cialis buy valium buy fioricet buy tramadol buy carisoprodol buy hydrocodone meridia didrex ambien adipex buy phentermine ambien adipex adipex xanax buy phentermine buy ambien buy adipex buy xanax buy xenical buy cialis buy valium buy cialis ultram vicodin meridia didrex levitra diazepam alprazolam propecia zoloft lipitor xenical phentermine ambien adipex phentermine xanax xenical cialis valium fioricet tramadol