Since so many people have asked for help in running external applications, I decided to write a simple tutorial to simply describe this process. I'm assuming that you want to run a compiler or interpreter, so this will revolve around that assumption, but if you read the NppExec commands, and have some knowledge of windows file systems, it should be a breeze to tweak the following guide.
1. Grab a copy of the binary NppExec (NppExec_***_dll.zip) at http://sourceforge.net/project/showfiles.php?group_id=189927&package_id=224034.
2. Close Notepad++ and unzip the file and place the DLL file in the plugins folder of Notepad++, so if you did the default install, place the DLL in c:\Program Files\Notepad++\plugins
3. Run Notepad++
4. Under the plugins menu item, there should be an entry saying NppExec. Click on the item that says execute under NppExec
5. Type in "NPP_run" the path of the application you want to run (c:\python25\python.exe for a default install of python 2.5), and "$(FILE_CURRENT_PATH)" (include the quotes for this) which is the variable for the file that is open.
6. So you should have typed something resembling:
NPP_RUN c:\python25\python.exe "$(FILE_CURRENT_PATH)"
for your script to run python
7. Save the script and now whenever you run your application, python for example, it will run your file.
8. To run it, go into nppexec under plugins (or press F6) and select the script, and click OK.
Remember that you can always include the parameters for your compiler, like you would do in a console window, but that you need NPP_exec before it, which basically says to run the application as a child of notepad++. Remember to include the quotes when you type "$(FILE_CURRENT_PATH)" since they tell the program to run that file. Also, keep in mind that depending on your system settings, program settings an all that stuff, your console may automatically close after running. In that case you may want to place a system("pause") (for you C programmers out there, yes, I know this is bad practice) or something to let you pause the program.
Hope this helps anyone out there
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, NPP_RUN is needed to run an application as external process - i.e. in its own window - whereas omitting NPP_RUN means run an application as a child process - i.e. in NppExec's console. For example:
NPP_RUN cmd <Enter> - opens cmd.exe in its own window
cmd <Enter> - runs cmd.exe inside NppExec's Console.
(where <Enter> means Enter key on your keyboard)
NPP_EXEC executes previously saved NppExec's script (set of commands) or executes commands directly from specified file.
Open NppExec's Console, type HELP and press Enter to see all available commands.
Type HELP NPP_RUN or HELP NPP_EXEC to see detailed info about the certain command.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With Kate I can edit a python file in one window and have the python interpreter running in an attached console window. When the time comes, I press the appropriate button on the toolbar and Kate pipes the code to the interpreter where it is run. This is quite nice, bu unfortunately Kate does not run under Windows. Is there a way to make Notepad++ behave in this manner?
Tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that the NPP_Exec developers are working to make a separate console window feature, but as far as I know, the features on kate that you describe are not available in Notepad++.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Found this and thought i would say it was very helpful. Thanks for the great write up.
I am running Iron Ruby in N++ as an interpreted script against my .Net Class Libraries and the output is piped to either the N++ console or the cmd prompt.
Thanks again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since so many people have asked for help in running external applications, I decided to write a simple tutorial to simply describe this process. I'm assuming that you want to run a compiler or interpreter, so this will revolve around that assumption, but if you read the NppExec commands, and have some knowledge of windows file systems, it should be a breeze to tweak the following guide.
1. Grab a copy of the binary NppExec (NppExec_***_dll.zip) at http://sourceforge.net/project/showfiles.php?group_id=189927&package_id=224034.
2. Close Notepad++ and unzip the file and place the DLL file in the plugins folder of Notepad++, so if you did the default install, place the DLL in c:\Program Files\Notepad++\plugins
3. Run Notepad++
4. Under the plugins menu item, there should be an entry saying NppExec. Click on the item that says execute under NppExec
5. Type in "NPP_run" the path of the application you want to run (c:\python25\python.exe for a default install of python 2.5), and "$(FILE_CURRENT_PATH)" (include the quotes for this) which is the variable for the file that is open.
6. So you should have typed something resembling:
NPP_RUN c:\python25\python.exe "$(FILE_CURRENT_PATH)"
for your script to run python
7. Save the script and now whenever you run your application, python for example, it will run your file.
8. To run it, go into nppexec under plugins (or press F6) and select the script, and click OK.
Remember that you can always include the parameters for your compiler, like you would do in a console window, but that you need NPP_exec before it, which basically says to run the application as a child of notepad++. Remember to include the quotes when you type "$(FILE_CURRENT_PATH)" since they tell the program to run that file. Also, keep in mind that depending on your system settings, program settings an all that stuff, your console may automatically close after running. In that case you may want to place a system("pause") (for you C programmers out there, yes, I know this is bad practice) or something to let you pause the program.
Hope this helps anyone out there
This very helpful for me
Thank you very much
edit: "$(FILE_CURRENT_PATH)" should be "$(FULL_CURRENT_PATH)"
Actually, NPP_RUN is needed to run an application as external process - i.e. in its own window - whereas omitting NPP_RUN means run an application as a child process - i.e. in NppExec's console. For example:
NPP_RUN cmd <Enter> - opens cmd.exe in its own window
cmd <Enter> - runs cmd.exe inside NppExec's Console.
(where <Enter> means Enter key on your keyboard)
NPP_EXEC executes previously saved NppExec's script (set of commands) or executes commands directly from specified file.
Open NppExec's Console, type HELP and press Enter to see all available commands.
Type HELP NPP_RUN or HELP NPP_EXEC to see detailed info about the certain command.
With Kate I can edit a python file in one window and have the python interpreter running in an attached console window. When the time comes, I press the appropriate button on the toolbar and Kate pipes the code to the interpreter where it is run. This is quite nice, bu unfortunately Kate does not run under Windows. Is there a way to make Notepad++ behave in this manner?
Tom
I think that the NPP_Exec developers are working to make a separate console window feature, but as far as I know, the features on kate that you describe are not available in Notepad++.
Found this and thought i would say it was very helpful. Thanks for the great write up.
I am running Iron Ruby in N++ as an interpreted script against my .Net Class Libraries and the output is piped to either the N++ console or the cmd prompt.
Thanks again.