Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>NPPExec has a rather convulated way of doing this. Here's what you need to do:</p> <ol> <li><p>Start by creating a text file for the commands. I named mine 'NppStartScript.txt' and saved it in the 'scripts' folder. Here's what the folder structure should look like: <strong>$(NPP_DIRECTORY)\scripts\NppStartScript.txt</strong> where <strong>$(NPP_DIRECTORY)</strong> represents your Notepad++ application folder.</p></li> <li><p>Locate the 'NppExec.ini' file. It should be in the '$(NPP_DIRECTORY)\plugins\config' folder. Open the file, add the following configuration setting at the bottom of the file (separated from the rest of the settings with a line break) and save the file:</p> <p><code>[Options]</code></p> <p><code>ScriptNppStart=$(NPP_DIRECTORY)\scripts\NppStartScript.txt</code></p></li> <li><p>Create the 'NppStartScript.txt', type your command(s) and save the file. In your case it would be: <code>npe_cmdalias alias = Full command</code></p></li> <li><p>"Full command" should be a npp_exec directive to a file which will contain the commands that you want to execute repeatedly. Here's what my run python command looks like: <code>npe_cmdalias rpy = npp_exec "$(NPP_DIRECTORY)\scripts\rpy.txt"</code></p></li> <li><p>The "rpy.txt" contains the command to invoke the python interpreter on the file that is open in the current Notepad++ tab. Here's what I have written: <code>D:\Portable Apps\Python\python.exe "$(FULL_CURRENT_PATH)"</code></p></li> <li><p>Restart Notepad++, open the NPPExec console and type your alias. It should run the command that you specified</p></li> </ol> <p>Hope this helps, let me know if you encounter any errors.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload