=== NppExec Manual === --- NppExec Manual --- --- 1. What is NppExec --- --- 1.1. Introduction --- NppExec is a plugin for Notepad++ which allows you to run some commands/programs directly from Notepad++ and provides an output window (NppExec's Console). NppExec can be used for running other programs from Notepad++, passing text from Notepad++ to some external tool, compiling source files (using external compiler) etc. When the NppExec plugin is installed, you can see its icon "Show Console Dialog" on Notepad++'es toolbar, and you can find NppExec's submenu under Plugins menu of Notepad++. You can always find the latest version of NppExec at https://sourceforge.net/projects/npp-plugins/ - it is there among other Notepad++'es plugins. --- 1.2. NppExec is... --- + NppExec is an intermediary between Notepad++ and external tool/compiler. It allows to run external tool/compiler directly from Notepad++. + NppExec is a Console window which can show the running process'es output, and can redirect the Console window's input to the running process (with some limitations). + NppExec is an interpreter of its own internal commands. NppExec can execute several commands one after another (so-called NppExec's script) from its "Execute..." dialog and can execute single command directly from its Console window. --- 1.3. NppExec is not... --- - NppExec is not a console emulator. NppExec redirects the running process'es output to its Console window, and can redirect the Console window's input to the running process (with some limitations). The NppExec's Console is not a "real" console window (actually, it uses RichEdit control for text input/output), it does not provide a console screen buffer. Thus, a console application which requires a "real" console screen buffer must be run in its own console window (using NPP_RUN command). - NppExec is not a command interpreter. NppExec does not understand such commands as 'copy', 'call', 'for' and so on because it is neither a "real" console nor a console emulator. However, NppExec has its own internal implementation of such commands as 'cls', 'cd', 'dir', 'echo', 'set' ('env_set') and introduces other, specific, commands. Also you can use "cmd /c " to execute any cmd's command inside NppExec. - NppExec is not a compiler. NppExec allows you to use external tools and compilers to process/compile your current file, but it has no ability to do it by itself. No magic here :) --- 2. Installation --- --- 2.1. What? Installation? --- Usually latest stable version of NppExec is included in Notepad++'es package, so you don't have to do anything manually. However, you may want to know: - what actually is the NppExec plugin and how can it be installed or removed; - how can you install the latest version of NppExec; - how can you use several copies of NppExec. --- 2.2. The NppExec plugin (NppExec.dll) --- NppExec is a dynamic-link library (DLL) implemented as a plugin for Notepad++. Actually (physically) the NppExec plugin is one file named "NppExec.dll". This file ("NppExec.dll") must be placed (copied) to Notepad++'es Plugins subfolder in order to work with Notepad++. --- 2.3. Installing the latest version --- You can always find the latest version of NppExec at https://sourceforge.net/projects/npp-plugins/ - it is there among other Notepad++'es plugins. Once you download the archive containing the latest "NppExec.dll" file, unpack this file ("NppExec.dll") to your Notepad++'es Plugins subfolder (you may need to overwrite your existing "NppExec.dll" with the latest one). Also you may be interested in the documentation inside the archive as it always contains the latest information about NppExec's commands and variables, advanced options and changes. If you are not sure about the "Notepad++'es Plugins subfolder", do the following: 1) locate the file "notepad++.exe" on your computer (usually it is located somewhere here: C:\Program Files\Notepad++\notepad++.exe); 2) go to the folder which contains the file "notepad++.exe" (e.g. C:\Program Files\Notepad++); 3) go to its subfolder "plugins" (e.g. C:\Program Files\Notepad++\plugins); 4) you are there! :) --- 2.4. Using several copies of NppExec --- You can have several copies of "NppExec.dll" in your Notepad++'es Plugins subfolder in order to have several NppExec's Console windows. Each copy of NppExec saves its own options and its own console commands history (if it is enabled in NppExec's options). In the same time, saved NppExec's scripts are shared between several copies of NppExec. To have several copies of "NppExec.dll", just copy it with different name(s), for example, "NppExec2.dll", "NppExecCpp.dll", "NppExecWeb.dll" and so on. This will give you additional NppExec's Console windows with the corresponding titles: "Console2", "ConsoleCpp", "ConsoleWeb" and so on. --- 2.5. Unicode and ANSI version --- There are two builds of NppExec: the Unicode build and the ANSI build. The Unicode build is compatible with Unicode Notepad++ and the ANSI build is compatible with ANSI Notepad++. You can check your version of Notepad++ by pressing F1 or from its main menu (? -> About Notepad++). You will see something similar to "Notepad++ v5.1.3 (UNICODE)" or "Notepad++ v5.1.3 (ANSI)". The corresponding version of NppExec (Unicode or ANSI) is required. I recommend you to use Unicode version of Notepad++. The ANSI version of Notepad++ exists just for compatibility with old non-Unicode systems (such as Windows 98 or Millenium) and with old non-Unicode plugins. Talking about NppExec, its Unicode build is more powerful because it has a full Unicode interface and supports ANSI, UTF-8, UCS-2 LE (Unicode wide characters in Windows) and UCS-2 BE input files. The ANSI version of NppExec supports just ANSI input files. It is caused by the following reason: conversion of UTF-8 or UCS-2 to ANSI may lead to loss of some Unicode characters which have no ANSI analogue. --- 3. Basic usage --- --- 3.1. Getting help --- The description of all commands and environment variables supported by current version of NppExec can be found in the file "NppExec.txt". Usually you can find this file in downloaded NppExec's archive [2.3] or in Notepad++'es Plugins subfolder [2.3] (in its "doc" subfolder). All advanced "hidden" settings of current version of NppExec are described in the file "NppExec_TechInfo.txt". Usually you can find this file in the same place where the file "NppExec.txt" is located. Remark: you can change some of the advanced settings using NppExec's Advanced Options dialog. The most recent and detailed information about all NppExec's commands and environment variables can be found in NppExec's built-in help. To use the built-in help, open NppExec's Console [3.5], type "help" and press Enter. You'll see a long list which contains: - NppExec's Console hotkeys; - NppExec's Console commands (which work in the Console only); - NppExec's general commands (which work everywhere in NppExec); - NppExec's predefined environment variables. To get detailed help about any NppExec's command, type "help " and press Enter. For example, "help set", "help inputbox", "help npp_exec" etc. The detailed help usually contains the command description, examples and remarks. This is the most essential information. Some additional information can be found in NppExec's Help/About window. For example: - You can execute commands and scripts directly from the Console window; - Commands are case-insensitive (i.e. NPP_OPEN is the same as Npp_Open); - and so on. --- 3.2. Do something (intro) --- The main principle of NppExec is the same as Notepad++'es "Run..." command (F5): to execute a command given. Usually it means to run some program/tool with specified parameters which can be passed in a form of Notepad++'es environment variables. For example, it allows you to launch your current file in Internet Explorer or to compile your current file using certain compiler. NppExec provides additional abilities for this: - it has a Console window to show the console program's output - it allows you to execute several commands one after another - it supports all Notepad++'es environment variables plus several own variables - it has additional commands which allow you to do more than you expect :) - it is cool :) NppExec actually provides four different ways to execute some command(s): 1) using NppExec's Console [3.5] - allows you to enter some command and execute it by pressing Enter; 2) using NppExec's dialog "Execute..." [3.6] - allows you to enter several commands (which will be executed one after another) and to save these commands as NppExec's script; 3) using NppExec's command "npp_exec