Menu

Snippets Plug-in?

2006-07-05
2012-11-14
  • Nobody/Anonymous

    some plug-in which it can handle Snippets of code since it does textmate, or gedit of gnomme, would be really fantastic, because the function to complete code with ctrl+space does not serve as much.

     
    • Nobody/Anonymous

      I prefer both, snippets replacement by typing of keywords and a drag'n'drop solution. I have a complete plugin in my mind, but I have no time to realize it. If anyone is interested to develope the plugin, we could discuss about the solution and HOWTODO it.

      For contact, see in my plugins help dialog box.

      Best Regards
      Jens

       
    • Nobody/Anonymous

      I second this. Just a little floating window, drag&drop snippet in it, drag&drop snippets of code back into your documents.

       
      • Nobody/Anonymous

        I would prefer an auto-insert style of snippets. When I type "function ", then it automatically replaces it with "function () {\n}" and places caret before the braces, right when I hit the space after the word "function". The word-snippet pairs should be of course user defined.

        I would write this plugin, it doesn't seem to be too complicated. But there is one thing that I don't know how to solve - I can make Scintilla to send a notification on every character typed (which is inevitable as the plugin has to do its action when SPACE is pressed), but Scintilla window notifies its container, which is Notepad++ itself, not my plugin. So, to implement any plugin that fires an action on an event in editor, there should be some support in Notepad++ for event forwarding from Scintilla control to plugins. Am I right?

         
        • Don HO

          Don HO - 2006-11-26

          You can intercept the scintilla notification by defining the function :
          void beNotified(SCNotification *notifyCode)

          The demo plugin insertion :
          http://notepad-plus.sourceforge.net/commun/misc/NppInsertPlugin.zip
          has the answer for your question.

          Don

           
    • Nobody/Anonymous

      agreed,