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

前端 未结 10 1441
北荒
北荒 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 01:07

    I've written just this to execute compiling and run the file after, plus fileinputname = fileoutputname on windowsmashines, if your compilerpath is registred in the windows PATH-var:

    NPP_SAVE
    cd "$(CURRENT_DIRECTORY)"
    set LEN~ strrfind $(FILE_NAME) .
    set EXENAME ~ substr 0 $(LEN) $(FILE_NAME)
    set $(EXENAME) = $(EXENAME).exe
    c++.exe "$(FILE_NAME)" -o "$(EXENAME)"
    "$(EXENAME)"
    

    should work for any compiler if you change c++.exe to what you want

提交回复
热议问题