NitroLite Documentation


Command Line Reference

Menu Commands

Using the Command Window

The Output Window

Built in Command Reference

Options Reference

Using Custom Tools

Using Sessions


Command Line Reference

Usage:
n2 [-s] [-l line_number] [-b] [-r script_file] [file1;[file2...]]
-s:Recurse into subdirectories
-l line_number:Goto the specified line number after opening the file
-b:Force opening files in binary mode
-r script_file:Runs the specified NitroLite script file. This can be used to open an existing session file or to set options specific to this session.
file:File specification that can include wildcards
Examples:
n2Launch NitroLite with a new file
n2 hello.txtopen hello.txt
n2 hello.txt;bye.txtopen hello.txt and bye.txt
n2 *.txtopen all the text files in the current directory
n2 -s *.txtopen all the text files in the current directory and all its subdirectories
n2 -l 20 hello.txtopen hello.txt and make line 20 the current line

The -l command is useful for external applications that can launch an editor and specify a line number on the command line. A good example is windiff. To use NitroLite with windiff, select Edit->Set Editor from the window menu. Set the editor string to: n2 -l %l %p. This tells windiff to launch NitroLite, open the current file and goto the current line.

Back



Menu Commands

File Menu Commands

Edit Menu Commands

Tools Menu Commands

Window Menu Commands

Help Menu Commands

File Menu Commands
CommandShortcut KeysDescription
NewCtrl+NCreate a new file
OpenCtrl+ODisplay the Open File Dialog. The list of file types used in the dialog is determined by the FileTypes option. See Options Reference for more information.
CloseCtrl+F4Close the current file.
SaveCtrl+SSave the current file
Save As Save the current file with a different name
Save All Save all open files
ExitAlt+F4Exit NitroLite

Edit Menu Commands
CommandShortcut KeysDescription
UndoCtrl+ZUndo last action
RedoCtrl+YRedo last action
CutCtrl+XCut selection to the clipboard
CopyCtrl+CCopy selection to the clipboard
PasteCtrl+VPaste the contents of the clipboard
DeleteDelDeletes the selection
Select AllCtrl+ASelect the whole file
Copy HtmlCtrl+Shift+HCopy selection as HTML and RTF to the clipboard
FindCtrl+FFind text in the current file
Replace Replace text in the current file
GotoCtrl+GGo to a line in the current file
BookmarkCtrl+F2Toggle bookmark on the current line
Quick OpenCtrl+Shift+GSearches for a file in the path specified by the QuickOpenPath option. The name of the file is specified by the word under the caret in the editor window, or the entire text of the command window if the command window is active

Tools Menu Commands
CommandShortcut KeysDescription
Stop ToolCtrl+BreakStop the currently executing custom tool
Record MacroCtrl+Shift+RRecord a macro. Issue the same command again to stop recording
Play MacroCtrl+Shift+PPlayback the last recorded macro
Customize Customize the Tools menu
Options Display the Options menu

Window Menu Commands
CommandShortcut KeysDescription
Split VerticallyAlt+Right ArrowCreate a new view by splitting vertically
Split HorizontallyAlt+Down ArrowCreate a new view by splitting horizontally
CloseAlt+Left ArrowClose the current window
Close All Close all windows
NextF6Select the next window
PreviousShift+F6Select the previous window
Next FileAlt+NSelect the next file
Previous FileAlt+PSelect the previous file

Help Menu Commands
CommandShortcut KeysDescription
Online Help Launch the web browser to the NitroLite online documentation pages
About Displays the about NitroLite dialog. The dialog displays the version number for NitroLite

Back


Other Commands (not displayed on the menu)
CommandShortcut KeysDescription
Next BookmarkF2Move to the next bookmark
Previous BookmarkShift+F2Move to the previous bookmark
Delete Word LeftCtrl+BackspaceDelete the word to the left of the cursor
Delete Word RightCtrl+DelDelete the word to the right of the cursor
Previous WordCtrl+Left ArrowMove to the previous word
Next WordCtrl+Right ArrowMove to the next word
Toggle Insert ModeINSSwitch between insert and overwrite mode
Clear selectionEscapeClear the selection (i.e. nothing is selected)
Beginning of lineHomeMove to the beginning of the current line
End of lineEndMove to the end of the current line
Beginning of fileCtrl+HomeMove to the beginning of the current file
End of fileCtrl+EndMove to the end of the current file
Page upPageUpMove to the previous page
Page downPageDownMove to the next page
Find nextF3Find the next match from last search
Find previousShift+F3Find the previous match from last search
Make topCtrl+TMake the current line the top line.

Back


Using the Command Window

NitroLite provides a command window for quickly accessing editor built in commands and launching external tools. Pressing Alt+C opens the command window. Type a command and press enter to execute the command. There are two main types of commands that can be executed:
  • Built in Commands: To execute a built in command, simply type the command and press enter. See the Built in Command Reference for more information on built in commands. The output of the executed command is directed to the Output Window.
  • External commands: To execute an external command, just type the command and press enter. The output of the external command is redirected to the Output Window. The external commands are launched through the current Windows command processor (cmd.exe on Windows NT/XP/Vista and higher, or command.com on Windows 95,98 and Me. This allows you to use commands the are provided by you command processor (e.g. dir). To try this:
    • Press Alt+C to open the command window
    • Type: dir (Enter)
    The output of the dir command is redirected to the Output Window.

Command Window History

The command window provides history functionality similar to most command consoles. When the command window is opened, the last command executed is selected in the command window. Use the Up Arrow and Down Arrow keys to cycle through the command history. Pressing F8 will attempt to find a command in the history the matches up to the current position in the command window. This allows you to quickly find long commands instead of typing in the entire command line. Example:
  • Press Alt+C to open the command window
  • Type: dir somereally_really_long_path (Enter)
  • Press Alt+C to open the command window
  • Type: dir (F8). The command window text should be set to dir somereally_really_long_path. Pressing enter will execute the command again.
If there are multiple commands that match the current text, pressing F8 will cycle through all available matches.

Command Window Path Completion

The NitroLite command window provides path completion functionality similar to that in command consoles. Using command completion can save you a lot of time when specifying file names in the command window. To complete the current path in the command window, simply press Tab. Example:
  • Press Alt+C to open the command window
  • Type: cd c:\prog (Tab)
  • The command window text should be set to cd "c:\Program Files". Pressing Tab again will cycle through more files or directories that match the search criteria..
The path completion also allows you to use wildcards in for specifiying the search criteria. Example:
  • Press Alt+C to open the command window
  • Type: e *.cpp (Tab)
  • Pressing tab will cycle through all the .cpp files in the current directory.

Back


The Output Window

The Output Window displays the output of commands launched from the command window or Custom Tools. The Output Window is created automatically as needed and is treated just like other NitroLite windows. Notice that closing the Output Window destroys the text currently contained in the output window.

Output Window Tags

The Output Window attempts to recognize filenames and line numbers. Double click or press Enter on a line with a filename/linenumber to open the file and goto the specified line. Tested formats include that produced by the Microsoft C/C++ compiler for errors and warnings as well as the output of findstr /n. Specifically, the supported formats are:
filename.ext(line_number) and
filename.ext:line_number
where filename.ext is the filename (fullpath, or relative to the current working directory) and line_number is the target line number in the file.

Back


Built in Command Reference

For more information see Using the Command Window.
For more information on path completion see Command Window Path Completion.
CommandShortcutDescription
cd(none)Changes the current working directory of NitroLite. The current directory is displayed in the status bar when the command window is active
editeEdit a file. Wildcards are allowed. If the file is currently open, the file is activated in the editor
filefPrints the full path of the file currently being edited to the command window. This allows you to quickly copy the name to the clipboard and paste it into the command prompt or other applications
quitqQuits NitroLite (prompts to save changes if needed.
quit!q!Quits NitroLite without prompting to save changes. All unsaved changes are lost!
pwd(none)Prints the current working directory to the command window so that the path can be quickly copied to the clipboard and pasted into the command prompt or other applications
helphDisplays a small built in command reference page. TODO: Currently not implemented in n2
cls(none)Clears the output window
console(none)Use console 1 to enable console mode. console 0 to disable. When in console mode, [Console] is displayed in the status bar when the command window is active. Output from all commands executed while in console mode is displayed in a consolidated Output Window.
historyhistDisplays the command history list
setopt(none)Handles displaying and setting option values. For more information see Options
unsetopt(none)Resets the specified option to the default value. TODO: Currently not implemented in n2. For more information see Options
runrRuns a NitroLite script. The script can contain any NitroLite builtin commands.
openedoOutputs a list of the currently open files with line numbers. Double clicking on a file opens the file for editing
bookmarkbmToggles bookmark at the specified line. With not parameters, toggles the bookmark at the active line
linelMakes the specified line number the active line. Note that when run from the command window the insertion caret is not displayed until the command window is closed
savesessionssSaves a NitroLite script to the specified filename. The script will open all files the are currently open and restores all bookmark locations.
saveopts(none)Saves the current option settings to the registry. TODO: Currently not implemented in n2.
sessionfile(none)Internal command used by session support.
setengine(none)Treat the current file as the specified extension. Example: "setengine cpp" causes NitroLite to use the C++ coloring engine custom syntax coloring engine for the current file. Custom extensions defined in NitroColor.ini or other custom engine files are allowed
#(none)Comment in a NitroLite script file.

Back


Options Reference

Most NitroLite options are accessible through the Tools->Options dialog. All options are accessible through the command window. You can use the setopt command to examine and modify options. Please note that options set using setopt are not saved. To save the options (i.e. make them persistent across sessions) use the saveopts command, or open the Tools->Options dialog and Click OK.
Using setopt:
setopt with no paramaters displays a list of the current options and their current values formatted for use in a NitroLite script. This allows you to quickly copy and paste into a script for modifying options.
setopt /? displays all known options with their types.
setopt option_name outputs the current value of the option to the command window for quick copy and pasting into other applications.
setopt option_name value sets the value of the specified option to value.
When specifying option names, if the category is missing (i.e. General., CPP. etc) General is assumed. So for example: setopt FontName will output Courier New to the command window. and setopt CommentFgColor will fail since General.CommentFgColor does not exist.
There are 3 types of options:
- DWORD options (i.e. numeric). Values should be specified as decimal integers.
- STRING options. Values should be specified as a single line string (spaces are allowed).
- COLOR options. Values should be specified as #rrggbb, where rr=red value in hex, gg=green value in hex and bb=blue value in hex.
You can use the unsetopt command to reset an option to it's default value.
Option Reference Table
NameTypeDefault ValueDescription
General.TabStopDWORD4The number of space characters per tab
General.ReplaceTabsDWORD00=Keep tabs, 1=Replace tabs with spaces
General.FontNameSTRINGCourier NewThe font to use. NitroLite currently only supports fixed width fonts. Using variable pitch fonts will cause display problems
General.FontSizeDWORD10The size of the font to use in points
General.FontBoldDWORD00=Normal, 1=Bold
General.CheckModifiedDWORD11=Check if files are modified outside NitroLite, 0=Don't check
General.ShowLineNumbersDWORD01=Display line numbers in the left margin, 0=don't display line numbers
General.ShowWhiteSpaceDWORD01=Display glyphs for whitespace characters. Spaces are displayed as a little ellipse. Tabs are displayed as a double right arrow.
General.TextFgColorCOLORThe default Windows window text color (based on Windows settings)The foreground color of the font (for normal coloring)
General.TextBgColorCOLORThe default Windows window text color (based on Windows settings)The foreground color of the font (for normal coloring)
General.SelectionFgColorCOLOR#ffffffForeground color of selected text
General.SelectionBgColorCOLOR#000000Background color of selected text
General.CaretWidthDWORD2The width of the input caret (cursor) in pixels
General.LeftMarginDWORD20The width of the left margin in pixels. The margin is used to display bookmarks and other information
General.LeftMarginColorCOLORThe default Windows scrollbar color (based on Windows settings)The color of the left margin
General.BookmarkColorCOLOR#00ffffThe backrgound color of the bookmark display glyph
General.LineNumFgColorCOLORSame as TextFgColorThe foreground color of the line number display
General.LineNumBgColorCOLORSave as TextBgColorThe foreground color of the line number display
General.FileTypesSTRINGSee FileTypes belowSee FileTypes below
General.QuickOpenPathSTRINGSee QuickOpen belowSee QuickOpen below
General.ColumnGuideDWORD0The number of characters at which to display the column wrap guide. 0=Disable
CPP.CommentFgColorCOLOR#007F00C/C++ comment foreground color
CPP.CommentBgColorCOLORSame as General.TextBgColorC/C++ comment background color
CPP.SingleLineCommentFgColorCOLOR#007F00C/C++ single line comment foreground color
CPP.SingleLineCommentBgColorCOLORSame as General.TextBgColorC/C++ single comment background color
CPP.KeywordFgColorCOLOR#0000ffC/C++ keyword foreground color
CPP.KeywordBgColorCOLORSame as General.TextBgColorC/C++ keyword foreground color
CPP.StringFgColorCOLOR#ff0000C/C++ literal string foreground color
CPP.StringBgColorCOLORSame as General.TextBgColorC/C++ literal string background color
CPP.NumberFgColorCOLOR#7f0000C/C++ constant number foreground color
CPP.NumberBgColorCOLORSame as General.TextBgColorC/C++ constant number background color
Html.TagFgColorCOLOR#0000ffHTML/XML tag foreground color
Html.TagBgColorCOLORSame as General.TextBgColorHTML/XML tag background color
Html.AttrFgColorCOLOR#7f007fHTML/XML attribute foreground color
Html.AttrBgColorCOLORSame as General.TextBgColorHTML/XML attribute background color
Html.AttrValueFgColorCOLOR#ff00ffHTML/XML attribute value foreground color
Html.AttrValueBgColorCOLORSame as General.TextBgColorHTML/XML attribute value background color
Html.StringFgColorCOLOR#ff0000HTML/XML string foreground color
Html.StringBgColorCOLORSame as General.TextBgColorHTML/XML string background color
Html.CommentFgColorCOLORC/C++ keyword foreground colorHTML/XML comment foreground color
Html.CommentBgColorCOLORSame as General.TextBgColorHTML/XML comment background color

Back

FileTypes Option

The General.FileTypes option controls what file types are displayed in the NitroLite open file dialog. The format for this option is different than other STRING options. The default value is:
C++ Files (*.cpp;*.c;*.cxx;*.h;*.hxx;*.es)\n*.cpp;*.c;*.cxx;*.h;*.hxx;*.es\nText Files (*.txt)\n*.txt\nHtml Files (*.htm;*.html;*.srf)\n*.htm;*.html;*.srf\nXML Files (*.xml; *.xsl)\n*.xml;*.xsl\nAll Files (*.*)\n*.*\n
all on one line. As you can see the format should be: display name\next1;ext2;...;extx\n.

Back

QuickOpen Option

The General.QuickOpen option specifies the path to search for files when the QuickOpen command is invoked. The default value is: .;%INCLUDE% The format is a ; delimited list of paths. NitroLite expands environment variables (when surrounded by a %). So the default value means search the current NitroLite working directory, then all directories that are part of the INCLUDE environment variable.

Back


Using Custom Tools

NitroLite allows you to launch tools from inside the editor and redirect the tool's output to a window in the editor. For example, it is often useful to get a directory listing in the editor. The following steps will guide you through setting up a custom tool for accomplishing this:
  1. Select Customize from the Tools menu.
  2. In the Customize Tools dialog, click on New.
  3. Enter &Dir in the Display Name field.
  4. If you use Windows NT or Windows 2000, enter cmd /c dir in the Command Line field
    . If you use Window 95, Windows 98 or WindowsMe, enter command /c dir in the Command Line field
    .
  5. Click in the Hot Key field and press the key you want to launch the tool (e.g. F11).
  6. Check the Prompt For Arguments checkbox.
  7. Check the Redirect Output checkbox.
Now you can try this tool by either:
  • Selecting Dir from the Tools menu, or
  • Pressing the hot key you specified when setting up the tool (e.g. F11)
The Enter arguments for tool dialog is displayed. Enter c:\ in the edit field and click the OK button.
A new NitroLite window will be created with the directory listing. Output windows are always read only. You can however select text, copy it and paste it in other windows. Alternatively, you can use the Save As command from the File menu to store the output for later reference.

Using Replacements in Custom Tools

Replacements can be used in custom tool command line arguments. These replacements allow you to access information contained in NitroLite and pass it on to the custom tool.
The following replacements are available:
ReplacementMeaning
%PATH%The full-path (including the filename) of the current file
%FILE%The filename (without the directory path and extension) of the current file
%DIR%The directory of the current file (without a trailing backslash)
%EXT%The extension of the current file

Back


Using Sessions

Session files are used to save a snap-shot of the current NitroLite environment. The session file is a NitroLite script file that opens all files that are currently open. The session file also includes the bookmarks that are currently set and the currently active lines.
To create a session file:
  • Open the command window (Alt+C)
  • type: ss path_to_file (where path_file is the file name of the session, e.g. c:\project\temp.ns)
  • After a session has been saved, you can save it again to the same file without specifying the file name by using the savesession command (ss) without any parameters
To load a session file from the command window:
  • run path_to_file
  • Note that loading a session file from the command window makes the new session file active. So subsequent calls to the savesession command without parameters will save to this file
To load a session file from the command line:
  • specify -r path_to_file on the command line
  • It is possible to load multiple session files from the command line, however the last file to be loaded is marked as the active session file, so subsequent calls to the save session command without parameters will save to this file
  • You can use the -r command line option to create explorer shortcuts for running NitroLite and loading a session file