An environment helper to program in JavaScript, PHP and AHK in Notepad++.
Despite the name, it actually does not help with setting it up, it only helps when everything else is done: if a file you are saving with a Control+S key combination in Notepad++ is a JavaScript or PHP file, the script will run a syntax check on them. When working on an AHK script, it will automatically reload it.
Lots of steps are necessary for the script to work as intended:
in Windows:
-
install MAMP (uncheck "MAMP Pro", if you do not have a paid account) or a standalone PHP engine
-
set "Run as administrator" in "Compatibility" section of AHK executable's settings
-
set "Run as administrator" in "Compatibility" section of NPP executable's settings OR -- since the flag is sometimes dropped with NPP updates -- use Task Scheduler to launch it with elevated rights
in NPP:
-
install JSLint plugin via "Plugins", "Plagins Admin..." menu
-
install NPPExect plugin via "Plugins", "Plagins Admin..." menu
in NppExec plugin within NPP:
-
in "Console Output..." menu, set "Console input/output encoding" to "UTF8/UTF" as otherwise non-ANSI paths will not be understood
-
in "Execute NppExec Script..." menu, create "Start AHK for NPP syntax check on save" script; for example: cmd.exe /C start "" "C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\Users\zxs\OneDrive\Рабочий стол\Прочее\NPP syntax check on save.ahk"
-
in "Advanced Options..." menu, add this script to "Execute this script when Notepad++ starts" field
-
in "Execute NppExec Script..." menu, create "PHP syntax check" script; for example: "C:\MAMP\bin\php\php8.1.0\php.exe" -l "$(FULL_CURRENT_PATH)"
-
in "Advanced Options..." menu, select this (#9) script in "Associated scripts" field
in NPP again:
-
restart NPP
-
assign specifically "alt+shift+F6" hotkey to the script #9) script via "Settings", "Shortcut Mapper...", "Plugin commands", "Execute NppExec Script..." (care for possible shortcut key conflicts)
-
for AHK's Function List panel to work follow the instructions like this and this. This will lead to updating
%APPDATA%\notepad++\functionList\overrideMap.xml
file and creating "akh.xml" in%APPDATA%\notepad++\functionList\
. Be careful to correctly put the name of User Defined Language inoverrideMap.xml
.