krot

NppExec commands

Dec 14th, 2017
234
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ****************************************************************************
  3. * NppExec plugin ver. 0.3.2 for Notepad++ 5.1 (and above)
  4. * by DV, December 2006 - September 2009
  5. * Co-developers: Nicolas Babled & Geert Vancompernolle (since July 2007)
  6. ****************************************************************************
  7. *
  8. * Possibilities:
  9. * 1) Run multiple commands from the "Execute..." dialog
  10. * 2) Run stand-alone command from the Console Dlg
  11. * 3) Separate console for each NppExec.dll (e.g. NppExec1.dll, NppExec2.dll)
  12. * 4) Additional commands:
  13. * cls - clear Console screen
  14. * cd - shows current path
  15. * cd <path> - changes current directory (absolute or relative)
  16. * cd <drive:\path> - changes current drive and directory
  17. * dir - lists subdirs and files
  18. * dir <mask> - lists subdirs and files matched the mask
  19. * dir <path\mask> - lists subdirs and files matched the mask
  20. * echo <text> - prints a text in the Console
  21. * set - shows all user's variables
  22. * set <var> - shows the value of user's variable <var>
  23. * set <var> = <value> - sets the value of user's variable <var>
  24. * unset <var> - removes user's variable <var>
  25. * env_set <var> - shows the value of environment variable <var>
  26. * env_set <var> = <value> - sets the value of environment variable <var>
  27. * env_unset <var> - removes/restores the environment variable <var>
  28. * inputbox "message" - shows InputBox, sets $(INPUT)
  29. * inputbox "message" : initial_value - InputBox, sets $(INPUT)
  30. * con_loadfrom <file> - loads a file's content to the Console
  31. * con_load <file> - see "con_loadfrom"
  32. * con_saveto <file> - saves the Console's content to a file
  33. * con_save - see "con_saveto"
  34. * sel_loadfrom <file> - replace current selection with a file's content
  35. * sel_load <file> - see "sel_loadfrom"
  36. * sel_saveto <file> - save the selected text to a file
  37. * sel_saveto <file> : <encoding> - save the selected text to a file
  38. * sel_save <file> : <encoding> - see "sel_saveto"
  39. * sel_settext <text> - replace current selection with the text specified
  40. * sel_settext+ <text> - replace current selection with the text specified
  41. * npp_exec <script> - execute commands from specified script
  42. * npp_exec <file> - execute commands from specified file (*)
  43. * npp_close - close current file in Notepad++
  44. * npp_close <file> - close specified file opened in Notepad++ (*)
  45. * npp_console <on/off/keep> - show/hide the Console window
  46. * npp_console <1/0/?> - show/hide the Console window
  47. * npp_open <file> - open a file in Notepad++
  48. * npp_open <mask> - open files matched the mask
  49. * npp_open <path\mask> - open files matched the mask
  50. * npp_run <command> - run external process/command
  51. * npp_save - save current file in Notepad++
  52. * npp_save <file> - save a file in Notepad++ (if it's opened) (*)
  53. * npp_saveall - save all modified files
  54. * npp_switch <file> - switch to specified opened file (*)
  55. * npe_cmdalias - show all command aliases
  56. * npe_cmdalias <alias> - shows the value of command alias
  57. * npe_cmdalias <alias> = - removes the command alias
  58. * npe_cmdalias <alias> = <command> - sets the command alias
  59. * npe_console <options> - set/modify Console options/mode
  60. * npe_debuglog <on/off> - enable/disable Debug Log
  61. * (*) these commands work with a partial file path/name also
  62. * i.e. npp_save c:\dir\f.txt is the same as npp_save f.txt
  63. * 5) Additional console commands (Console Dlg only):
  64. * help - show available commands
  65. * ver - show plugin's version
  66. * CTRL+C - terminate current child process
  67. * CTRL+BREAK - terminate current child process
  68. * 6) All Notepad++ environment variables are supported:
  69. * $(FULL_CURRENT_PATH) : E:\my Web\main\welcome.html
  70. * $(CURRENT_DIRECTORY) : E:\my Web\main
  71. * $(FILE_NAME) : welcome.html
  72. * $(NAME_PART) : welcome
  73. * $(EXT_PART) : .html
  74. * $(NPP_DIRECTORY) : the full path of notepad++'s directory
  75. * $(CURRENT_WORD) : word(s) you selected in Notepad++
  76. * $(CURRENT_LINE) : current line number
  77. * $(CURRENT_COLUMN) : current column number
  78. * 7) Additional environment variables:
  79. * $(#0) : C:\Program Files\Notepad++\notepad++.exe
  80. * $(#N), N=1,2,3... : full path of the Nth opened document
  81. * $(LEFT_VIEW_FILE) : current file path-name in primary (left) view
  82. * $(RIGHT_VIEW_FILE) : current file path-name in second (right) view
  83. * $(PLUGINS_CONFIG_DIR) : full path of the plugins configuration directory
  84. * $(CWD) : current working directory of NppExec (use "cd" to change it)
  85. * $(ARGC) : number of arguments passed to the NPP_EXEC command
  86. * $(ARGV) : all arguments passed to the NPP_EXEC command after the script name
  87. * $(ARGV[0]) : script name - first parameter of the NPP_EXEC command
  88. * $(ARGV[N]) : Nth argument (N=1,2,3...)
  89. * $(RARGV) : all arguments in reverse order (except the script name)
  90. * $(RARGV[N]) : Nth argument in reverse order (N=1,2,3...)
  91. * $(INPUT) : this value is set by the 'inputbox' command
  92. * $(INPUT[N]) : Nth field of the $(INPUT) value (N=1,2,3...)
  93. * $(OUTPUT) : this value can be set by the child process, see npe_console v+
  94. * $(OUTPUT1) : first line in $(OUTPUT)
  95. * $(OUTPUTL) : last line in $(OUTPUT)
  96. * $(SYS.<var>) : system's environment variable, e.g. $(SYS.PATH)
RAW Paste Data