• Login
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.
  • O
    osgaldor
    last edited by Apr 2, 2022, 5:38 PM

    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!

    A 1 Reply Last reply Apr 2, 2022, 7:58 PM Reply Quote 0
    • A
      Alan Kilborn @osgaldor
      last edited by Apr 2, 2022, 7:58 PM

      @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
      • D
        Derek Brown
        last edited by Derek Brown Apr 7, 2022, 10:00 AM Apr 7, 2022, 9:59 AM

        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
        2 out of 3
        • First post
          2/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors