Menu

Awk plugin (written in C#)

2007-09-02
2012-11-14
  • Maxime Prat

    Maxime Prat - 2007-09-02

    I programmed a small plugin which is formally a front-end to gawk (you can download it with a lof of unix utilities there : http://sourceforge.net/projects/unxutils\).

    http://artiche.info/npp/NppAwkPlugin_bin.zip
    http://artiche.info/npp/NppAwkPlugin_src.zip

    As it is written in C#, you need the .Net framework 2.0 or above to be installed on your computer.
    You also need the program gawk.exe
    ... and of course you need to learn gawk language if you don't already know it.

    installation instructions (I suppose N++ is installed in the directory C:\Program Files\Notepad++):

    - copy NppAwkPluginCpp.dll in C:\Program Files\Notepad++\plugins
    - create the directory C:\Program Files\Notepad++\DotnetPlugins
    - copy NppAwkPluginCS.dll in C:\Program Files\Notepad++\DotnetPlugins
    - open a MS-DOS Command window (run cmd)
    - enter the following command : gacutil /i C:\Program Files\Notepad++\DotnetPlugins\NppAwkPluginCS.dll

    Here is a screenshot : http://artiche.info/npp/img/NppAwkPluginScr.jpg

    There are a lot of possible improvement : syntax highlighting, make it dockable, make it able to work on all opened files, etc... but anyway, even that very basic front-end may be very useful !

     
    • DV

      DV - 2007-09-03

      Great idea, man! That's what I missed in my NppExec plugin - a dialog with input field from Notepad++ and output field to Notepad++! I also use AWK often, but did not arrive at such realization! It will be cooool! :-)

       
    • Maxime Prat

      Maxime Prat - 2007-09-03

      Thanks !
      But I shouldn't code until 2h40 am... the version that I published contains 2 huge bugs. I'll post the fix this evening.

      I have another idea for my plugin : connect it to a webservice to share scripts between everyone. I started to work on that this week end.

       
    • Maxime Prat

      Maxime Prat - 2007-09-03

      I updated the files to fix two bugs that were :
      - a problem with saving end of lines of the scripts
      - the plugin was freezing when it had to write too much lines in the standard output

      http://artiche.info/npp/NppAwkPlugin_bin.zip
      http://artiche.info/npp/NppAwkPlugin_src.zip

      to install, see above.
      if the plugin was already intalled, just replace the C# dll (NppAwkPluginCS.dll) and re-add it to the GAC :

      first remove it from the GAC :
      gacutil /u C:\Program Files\Notepad++\DotnetPlugins\NppAwkPluginCS.dll

      then add it again :
      gacutil /i C:\Program Files\Notepad++\DotnetPlugins\NppAwkPluginCS.dll

       
    • Maxime Prat

      Maxime Prat - 2007-09-04

      Hi again,

      I'm trying to use my plugin on another comp than mine (I'm trying win2k) and it appear that I have some work to make it work anywhere : the C# plugin don't like to be installed anywhere, I have a problem with creating directories, I have a problem with paths containing space char.

      I hope to find a solution for everything...

       
    • Nobody/Anonymous

      A good solution will be to port it to plain c/c++ ;)

      Best Regards
      Jens

       
      • Don HO

        Don HO - 2007-09-04

        It's true that Notepad++ (and most of plugins) is coded in c/c++. However it doesn't mean that Notepad++ users should use only c/c++ (and don't forget the tool it-self supports the varied languages other than c/c++). 

        Contrarily, I think it's a good thing so that c#, Delphi or python (pyNpp) users can use more frequently Notepad++ : it will give another horizons to the project.

        In anyway, Notepad++ should be a way but not a goal, in order to offer the maximum possibilities to the developers. I think that's the only way to enrich Notepad++.

        BTW, please let me know when the project reaches to the stable state, so that I can publish your project on Notepad++ site.

        Don

         
        • Nobody/Anonymous

          In fairness it's as easy to write a plugin in C++ as it is in C#. It's all just Win32 whether it be managed or unmanaged. The big advantage of having them in C++ is it requires nothing extra to be installed such as the .net framework. The joy of N++ is that's it's lightning fast and doesn't require any big external libraries. Now can you imagine if I decided to write an explorer plugin in my favourite language Java. All of you would have to install the JRE to use it. Would you be happy to ? Probably not.

           
          • Don HO

            Don HO - 2007-09-06

            The advantage of plugin system is modular, it means that user can add or remove a plugin as wish.

            > Now can you imagine if I decided to write an explorer plugin in my favourite language Java.
            > All of you would have to install the JRE to use it. Would you be happy to ? Probably not.

            Probably not for those who don't have JRE installed in theire system.
            But surely yes for whom has already JRE installed.

            Don

             
    • Maxime Prat

      Maxime Prat - 2007-09-04

      Sure, I'm waiting for your contribution !

      More seriously, programming is my job and my pleasure. And C# is the language I know the best today. Programming that plugin in C# if for me a challenge (communication between C# and unmanaged C++ isn't so trivial), and a training.

      ... and I don't know/like C++

      Anyway, I already found a solution to most of my actual problems. I'll post an update this evening.

       
    • Nobody/Anonymous

      If you can do it make standalone - without the .NET Framework - maybe I would like to use your plugin. But I don't like to install .NET, Java runtime or Phyton to display/use plugins in Notepad++.
      Is there no way to port from C# to C++?

      Best Regards
      Jens

       
      • Nobody/Anonymous

        I forgot something:

        You want my contribution?
        I just tell: HexEditor, Explorer, FunctionList, SpellChecker or the docking machanism ;)
        Fell free to use!

        Best Regards
        Jens

         
    • Maxime Prat

      Maxime Prat - 2007-09-04

      Don't get upset, I know you are a great contributor (and I use your contribution, especially FunctionList which is great). But telling me that the solution to my problems is to port my plugin to unmanaged C++ was clearly a provocation, don't be surprised if I ask you to port it yourself.

      My goal is also to use that mechanism of interoperability, mainly to learn how to use it. I could just do it on my side without sharing anything... but I think (maybe I'm wrong) that this example of unmanaged C++ / C#.Net interoperability may interest some people.

      And actually, there is nothing complex in my plugin : It's just a front-end. So yes, there is a way to port it to unmanaged C++ : you just have to rewrite everything which is not complex for someone who is familiar with C++. But I won't do it because it's not my aim (and I'm not familiar with C++ ;)).

      Anyway, if you don't want to install anything to display my plugin just wait for Vista. The .Net Framework 2 is already inside.

      Sincerely yours.
      Max

       
MongoDB Logo MongoDB