• Login
Community
  • Login

Plugin for opening files from clicking text in a file?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 8 Posters 1.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    GreatMCGamer
    last edited by Sep 26, 2019, 6:02 PM

    I need a plugin that will detect string " function " with white spaces, and then read "FolderName:FileName " (Ending to a white space) and make that text region clickable.
    When clicked the plugin will look for the specified file by going 2 folders backwards from the file I was clicking the text from, then open “FolderName” and then “functions” and then open “FileName” into a new tab in Notepad++…
    If there is “FolderName:OtherFolderName/FileName” (“OtherFolderName” is in the directory where “FileName” would have been) It would be nice to detect that too.
    These files are in appdata most of the time so that might effect the code aswell for it to have permissions to go around those files.
    Would make life a lot easier for a handful of .mcfunction “scripters”.

    G R 2 Replies Last reply Sep 27, 2019, 7:15 PM Reply Quote 1
    • P
      PeterJones
      last edited by Sep 26, 2019, 6:39 PM

      I doubt there’s any plugin for that specific task. There might be one that allows generic cross-linking of some sort, but I don’t know it.

      Really, that sounds like a job for one of the scripting plugins, like PythonScript or LuaScript. I don’t know if it could handle every requirement, but it might be able to make a close approximation. (it’s the making the specially-highlighted strings clickable that I think would cause the most difficulty).

      But either as a new plugin, or a script in a scripting plugin, it would take significant coding, and you probably aren’t going to get anyone to code it for you for free. Since you mentioned “scripters”, that might mean you have enough coding skill to do it yourself, but I don’t know.

      • PythonScript project and download page
        • PythonScript Install Instructions for recent Notepad++ versions
      • LuaScript project and download page
        • I believe you can install LuaScript directly from Plugins > Plugins Admin without having to follow special directions.
      1 Reply Last reply Reply Quote 1
      • D
        David Spector
        last edited by Sep 27, 2019, 4:14 PM

        I need clickable text too, since I’m used to it from Notetab Pro (I had to move because it doesn’t support Unicode).

        I need two commands (bound to separate keystrokes):

        • Click pathname to open that file for editing (if detecting pathnames is too hard, requiring surrounding square brackets [] is sufficient)

        • Click URL to open in default browser (again, using surrounding square brackets is sufficient).

        D 1 Reply Last reply Sep 27, 2019, 4:56 PM Reply Quote 0
        • M
          Michael Vincent
          last edited by Sep 27, 2019, 4:34 PM

          @David-Spector said in Plugin for opening files from clicking text in a file?:

          Click URL to open in default browser

          You can accomplish this from “Settings” menu => “Preferences” item => “MISC” section and “Clickable Link Settings” check “Enable” box.

          The former - open file can be done with a scripting plugin. I highlight text that is a filename in N++ and then I have Ctrl-Alt-O shortcut mapped to “Open Include File” which is an NppExec command:

          NPP_CONSOLE keep
          NPE_CONSOLE -- v+
          "$(NPP_DIRECTORY)\plugins\nppExtTasks.bat" openinc "$(FULL_CURRENT_PATH)" $(CURRENT_WORD)
          NPP_OPEN $(OUTPUT)
          NPE_CONSOLE -- v-
          

          and the “nppExtTasks.bat” script mentioned above does some logic about directory back tracing and looking in certain include directories if the file extension of the original file is “.c” or “.pl” or other such stuff. If it’s in the same directory:

          NPP_OPEN $(CURRENT_WORD)
          

          would be sufficient.

          Cheers.

          1 Reply Last reply Reply Quote 3
          • D
            dinkumoil @David Spector
            last edited by Sep 27, 2019, 4:56 PM

            @David-Spector

            Instead using a scripting plugin it is also possible to use the Open Selection plugin, which is especially made for opening files whose file names are currently selected in a document’s text. You can even configure it to use standard paths (e.g. for include files in the C programming language).

            The plugin can be installed via PluginsAdmin and is available in 32 bit and 64 bit versions.

            1 Reply Last reply Reply Quote 3
            • A
              Alan Kilborn
              last edited by Sep 27, 2019, 5:16 PM

              @David-Spector said in Plugin for opening files from clicking text in a file?:

              Click pathname to open that file for editing

              How about simply go to the Edit menu, choose On Selection, then choose Open File?

              It’s annoying to open a series of menus, but can be bound to a keycombo as well for quick access. Of course, you have to have some selected text first…

              1 Reply Last reply Reply Quote 3
              • G
                gstavi @GreatMCGamer
                last edited by Sep 27, 2019, 7:15 PM

                If your core requirement is “open file from text” then a tag lookup plugin can help.
                When generating “tags” file you can indicate to treat each file as a tag and probably (I never tried) to treat ONLY files as tags.
                That way looking up a file name will open it.
                I use it constantly for #include <somefile.h> statements.

                I didn’t follow your exact requirement, they looked extremely specific to your use case so your only hope is to write your own plugin or script.

                1 Reply Last reply Reply Quote 2
                • R
                  rinku singh @GreatMCGamer
                  last edited by rinku singh Sep 28, 2019, 9:20 AM Sep 28, 2019, 9:17 AM

                  @GreatMCGamer said in Plugin for opening files from clicking text in a file?:

                  When clicked the plugin will look for the specified file by going 2 folders backwards from the file

                  find_and_open_file_x86.zip

                  find_and_open_file_x64.zip

                  wacth at youtube

                  1 Reply Last reply Reply Quote 0
                  6 out of 8
                  • First post
                    6/8
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors