NT Editor
User Manual
Night2 Text Editor
July 28, 2025
Version 1.2
Jon S. <jon@centaur.pw>
https://www.centaur.pw
Table of Contents
About NT Editor
NT Editor is a utility for creating and editing Night files for use with night2
.
All Night codes can be inserted using organized toolbar items or keyboard shortcuts.
Files can be opened and saved using ASCII or UTF-8 character encoding, and line breaks can be saved
as either LF
or CRLF
.
Various view customizations are automatically saved on exiting the program and loaded when starting.
Program Startup
When loading NT Editor, the program will first search for the file nt_editor.cfg
in the path
containing the program executable and sets user-defined view settings based on the contents of this file.
If the file is not found, no error occurs and the program proceeds using its built-in default settings.
NT Editor will load in a blank state if no file was specified on opening. The program can only be loaded with one file at a time; additional files passed through the command line or drag-and-drop will be ignored. Files can be opened with the program by dropping the file on the NT Editor program or a shortcut to it, but files cannot be dropped onto the program window.
On program exit, the current view settings will be written to nt_editor.cfg
in the program
directory. The file is overwritten if it already exists, otherwise it is created.
User Interface
The File menu contains the Encoding and End of Line sub-menus in addition to common file operations.
The Edit menu contains text editing operations Undo, Select All, Cut, Copy, and Paste.
The options contained in the View menu are all saved when the program exits, and any changes made to them will take effect immediately. These menu items are described in View Configuration.
Four toolbars below the program menu provide shortcuts to commonly used menu items as well as all Night
codes. Each button on the toolbar has an associated keyboard shortcut; these are listed in
Keyboard Shortcuts. Clicking on a code button will insert that code into the text at the
current caret position if no text is selected. If text is selected when the button is clicked, the code
will placed at the beginning of the selection and :reset: will be placed at the end, except in the
case of :center: or :box:, which will place :.center: or :.box: at the end of
the selected text. Certain other codes meant to be used independently will not append anything to the selection.
When Ctrl
is pressed, numbers are displayed on each of the color buttons to indicate which
keyboard shortcut will insert the corresponding color code. To insert foreground color codes, hold the
Ctrl
key and press the desired number key. To insert background color codes, hold the
Ctrl
and Shift
keys and press the desired number key. Use the number keys above
the letter keys rather than number pad keys.
View Configuration
Always On Top keeps the NT Editor window on top of all other windows when checked.
Word Wrap wraps the text in the input box when checked.
Font allows the user to select the font face, size and style.
Text Color allows the user to set the text color of the input box.
Background Color allows the user to set the background color of the input box.
In addition to the above-mentioned settings, NT Editor also saves the selected character encoding and
end-of-line character in nt_editor.cfg
, as well as window dimensions.
Revert to Defaults will restore all settings to their default state, including character encoding and end-of-line options selected in the File menu.
The structure of the nt_editor.cfg
file and its default values are shown below:
TextColor=-16777216
BackgroundColor=-1
FontFamily=Courier New
FontSize=12
FontStyle=Regular
AlwaysOnTop=False
WordWrap=False
Encoding=utf-8
EndOfLine=LF
WindowWidth=603
WindowHeight=432
Settings are saved by the program in the order shown, but can be read in any order. If a setting is defined more than once in the file, the final definition will be used. Lines in the file that do not begin with a valid setting name are ignored when loading the file. Incorrect values or invalid syntax may cause unexpected behavior. Any settings missing from the file will take on their respective default values.
Keyboard Shortcuts
General
Key Sequence | Function |
F1 | Help |
Ctrl+O | Open File |
Ctrl+S | Save File |
Ctrl+Shift+S | Save File As |
Ctrl+Z | Undo |
Ctrl+A | Select All |
Ctrl+X | Cut |
Ctrl+C | Copy |
Ctrl+V | Paste |
Codes
Key Sequence | Night Code | Description |
Ctrl+1 | :black: | Foreground Black |
Ctrl+2 | :red: | Foreground Red |
Ctrl+3 | :green: | Foreground Green |
Ctrl+4 | :yellow: | Foreground Yellow |
Ctrl+5 | :blue: | Foreground Blue |
Ctrl+6 | :purple: | Foreground Purple |
Ctrl+7 | :cyan: | Foreground Cyan |
Ctrl+8 | :white: | Foreground White |
Ctrl+Shift+1 | :bgblack: | Background Black |
Ctrl+Shift+2 | :bgred: | Background Red |
Ctrl+Shift+3 | :bggreen: | Background Green |
Ctrl+Shift+4 | :bgyellow: | Background Yellow |
Ctrl+Shift+5 | :bgblue: | Background Blue |
Ctrl+Shift+6 | :bgpurple: | Background Purple |
Ctrl+Shift+7 | :bgcyan: | Background Cyan |
Ctrl+Shift+8 | :bgwhite: | Background White |
Ctrl+B | :bold: | Bold Text |
Ctrl+I | :italic: | Italic Text |
Ctrl+U | :underline: | Underline Text |
Ctrl+K | :strike: | Strikeout |
Ctrl+F | :faint: | Faint Text |
Ctrl+R | :reverse: | Reverse Video |
Ctrl+0 | :reset: | Reset |
Ctrl+T | :center: | Center Text1 |
Ctrl+M | :box: | Enclose Text2 |
Ctrl+N | :newline: | Newline |
Ctrl+E | :none: | None |
Ctrl+9 | :clear: | Clear Screen |
Ctrl+Shift+9 | :cursor: | Reset Cursor |
Ctrl+Q | :start: | Save Cursor |
Ctrl+W | :restore: | Restore Cursor |
Ctrl+Shift+Up | :up: | Cursor Up |
Ctrl+Shift+Down | :down: | Cursor Down |
Ctrl+Shift+Left | :left: | Cursor Left |
Ctrl+Shift+Right | :right: | Cursor Right |
1 :center: must be terminated with :.center:. If :center: is inserted while text is selected, :.center: will be placed at the end of the selection automatically; it must be entered manually if no text was selected.
2 :box: must be terminated with :.box:. If :box: is inserted while text is selected, :.box: will be placed at the end of the selection automatically; it must be entered manually if no text was selected.
Night Code Table
The tables below illustrate all Night2 codes and the ANSI sequences they correspond to. Night1 codes are not shown in this manual, but are fully supported unless this was disabled before compilation.
Color | Night Code | Equivalent Character Sequence |
Foreground Black | :black: | \e[30m |
Foreground Red | :red: | \e[31m |
Foreground Green | :green: | \e[32m |
Foreground Yellow | :yellow: | \e[33m |
Foreground Blue | :blue: | \e[34m |
Foreground Purple | :purple: | \e[35m |
Foreground Cyan | :cyan: | \e[36m |
Foreground White | :white: | \e[37m |
Background Black | :bgblack: | \e[40m |
Background Red | :bgred: | \e[41m |
Background Green | :bggreen: | \e[42m |
Background Yellow | :bgyellow: | \e[43m |
Background Blue | :bgblue: | \e[44m |
Background Purple | :bgpurple: | \e[45m |
Background Cyan | :bgcyan: | \e[46m |
Background White | :bgwhite: | \e[47m |
Style | Night Code | Equivalent Character Sequence |
Bold Text | :bold: | \e[1m |
Faint Text | :faint: | \e[2m |
Italic Text | :italic: | \e[3m |
Underline | :underline: | \e[4m |
Strikeout | :strike: | \e[9m |
Reverse Video | :reverse: | \e[7m |
Reset All | :reset: | \e[0m |
Begin Center Text | :center: | N/A |
End Center Text | :.center: | N/A |
Begin Box | :box: | N/A |
End Box | :.box: | N/A |
Newline | :newline: | \n |
None | :none: | Space + \b |
Screen/Cursor | Night Code | Equivalent Sequence |
Clear Screen | :clear: | \e[2J |
Reset Cursor | :cursor: | \e[;H |
Save Cursor | :start: | \e7 |
Restore Cursor | :restore: | \e8 |
Cursor Up | :up: | \e[1A |
Cursor Down | :down: | \e[1B |
Cursor Left | :left: | \e[1D |
Cursor Right | :right: | \e[1C |
Copyright © Centaur, 2025. All Rights Reserved.