How to compile and run C files from within Notepad++ using NppExec plugin?

前端 未结 10 1438
北荒
北荒 2020-11-30 00:45

How can I configure the NppExec plugin for Notepad++?

I would like NppExec to compile my C files, run them, and show their output, all within Notepad++.

10条回答
  •  隐瞒了意图╮
    2020-11-30 00:56

    I recommend my solution. My situation: g++(cygwin) on win10

    My solution: Write a .bat batch file and execute compiler in that batch. compileCpp.bat

    @echo off  
    set PATH=%PATH%;C:\cygwin64\bin\
    rm %~n1.exe
    c++.exe -g %~dpnx1 -o %~dpn1.exe
    %~n1.exe  
    

    Console:

    NPP_EXEC: "runCpp"
    NPP_SAVE: E:\hw.cpp
    CD: E:\
    Current directory: E:\
    cmd /c C:\cygwin64\bin\compileCpp.bat "hw.cpp"
    Process started >>>
    Hello World<<< Process finished. (Exit code 0)
    ================ READY ================
    

提交回复
热议问题