Community
    • Login

    Where to begin

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    3 Posts 3 Posters 389 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.
    • osgaldorO
      osgaldor
      last edited by

      I’m an intermediate level developer and I want to develop a simple plugin for Notepad++ but for all I know the essential functionality may already have been implemented.

      In a nutshell, I want to hook into the file|new method and invoke a dialog to select a new file based on a user-created set of templates. So Ineed to be able to crack into the file menu and call a new dialog to load a template that I will have predefined.

      To me this seems like reallly basic functionality for any kind of text editor so I’m sure there are already components built that can be retasked to my purposes. Could someone point me in the right direction?

      Thanks in advance!

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @osgaldor
        last edited by

        @osgaldor

        So I maybe do something similar. When a new Python file is made by the user, i.e., he saves an empty .py file, I have something that detects that and then fills the content of the Notepad++ tab with “boilerplate” code for a Python program.

        1 Reply Last reply Reply Quote 3
        • Derek BrownD
          Derek Brown
          last edited by Derek Brown

          I believe you could use the NPPN_FILEOPENED notification and check the filename to see if it’s a new file (it will have no path and just a name like “new 1”). Then run your code to have the user select a template and insert text.

          Alternatively, you could just create a menu command for your plugin that lets the user select a template, then create a new file with that template text. Also note that the user can bind shortcut keys to plugin menu items.

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