Rejbrand Text Editor: Documentation
Introduction
Rejbrand Text Editor is an advanced Unicode text editor for Microsoft Windows (desktop application). This document describes the basics and the more advanced features of the software.
Keyboard Commands
Moving the Caret
- Left
Moves the caret one character to the left.
- Right
Moves the caret one character to the right.
- Up
Moves the caret to the previous line.¹
- Down
Moves the caret to the next line.¹
- Ctrl+Left
Moves the caret one word to the left.
- Ctrl+Right
Moves the caret one word to the right.
- PgUp
Moves the caret one screen up.
- PgDn
Moves the caret one screen down.
- Home
Moves the caret to the beginning of the current line, if not already there. If already there, moves the caret to the first non-whitespace character on the line.
- End
Moves the caret to the end of the current line.
- Ctrl+Home
Moves the caret to the beginning of the file.
- Ctrl+End
Moves the caret to the end of the file.
- Left mouse button
Moves the caret to the character position just below the mouse cursor.
- Shift+Ctrl+Alt+C
Enables or disables the possibility of the caret to be positioned beyond the end of line (EOL).
- Alt + Scroll wheel
Moves the caret to the previous or next line.¹
¹ If “Caret beyond EOL” is enabled, the column will not change. If “Caret beyond EOL” is not enabled, the column will be changed to the minimum of the previous column and the length of the new line. If you repeatedly press the Up and Down arrow keys, the initial column of the caret will be remembered, and each time the caret is moved to a new line, the column will be set to the minimum of the initial column and the length of the new line.
Editing the Text
- Character key (e.g. A)
Inserts the character in the text at the current caret position, replacing any selection.
- Backspace
Deletes the current selection, if any, or deletes the character to the left of the caret.
- Ctrl+Backspace
Deletes the current selection, if any, or deletes the word to the left of the caret.
- Delete
Deletes the current selection, if any, or deletes the character to the right of the caret.
- Ctrl+Delete
Deletes the current selection, if any, or deletes the word to the right of the caret.
- Ctrl+Shift+Up
Swaps the current line and the line right above the current line. (This is like Shift+Alt+Up in Microsoft Word.)
- Ctrl+Shift+Down
Swaps the current line and the line right below the current line. (This is like Shift+Alt+Down in Microsoft Word.)
- Ctrl+D
Clears the current line.
- Ctrl+Shift+Space
Increases the indent on all selected lines.
- Ctrl+Shift+Backspace
Decreases the indent on all selected lines.
- Ctrl+X
Cut: Removes the current selection and puts it in the clipboard.
- Ctrl+C
Copies the current selection to the clipboard. If there is no selection, the current word is copied.
- Ctrl+V
Paste: Replaces the current selection, if any, with the content of the Windows clipboard.
- Ctrl+Shift+V
Paste as: Displays the “Paste as” dialog box. Using this, you may, for instance, paste a number of plain-text lines as an HTML list, or as a set of HTML paragraphs.
- Ctrl+Shift+Alt+V
Pastes the contents of the clipboard as an overwriting block with its upper-left corner (character) at the caret.
- Ctrl+Z
Undoes the previous operation in the undo list.²
- Ctrl+Y
Redoes the next operation in the undo list.²
- Ctrl+Shift+Z
Displays the History window, showing the version history of the current file.
- Ctrl+U
When used with a hexadecimal codepoint (e.g. 222b) just to the left of the caret, the number is replaced by the corresponding Unicode character. (This is like Alt+X in Microsoft Word.)
- Left mouse button
Click and hold to drag the current selection, to move it to a new location in the file or in a different document. With the Ctrl modifier, the text is copied instead of moved.
- Ctrl+H
Synonym for Backspace.
- Ctrl+J
Inserts a tab character (U+0009: CHARACTER TABULATION).
- Insert
Toggles insertion/overwrite mode. The current mode is shown in the status bar (INS or OVER) and by the caret (❘ or █).
- Pause
Toggles read-only mode on/off.
² Most contemporary Windows text editors offer multi-step undo. But most of these share the established Windows multi-undo model, which has a major flaw: if you undo a number of steps, to history version X of the file, say, and then modify the file, the undo history is truncated at X, so all history versions after X are lost (you cannot “redo” these).
This is dangerous, for instance, if you undo a large number of steps to recover a string you want to copy to the clipboard with the intention of redoing all steps immediately afterwards. If you accidentally make an edit to the file before or after you copy the string (say, by slipping and pressing C instead of Ctrl+C), all changes you made to the file after the restored version are permanently lost.
In Rejbrand Text Editor, this “flaw” doesn't exist: instead, when you make an edit and you are not at the end of the history stack, the old, restored, version is copied to the end of the stack, and no version in the history is deleted.
Working with Selections
- Shift+Left
Expands the selection one character to the left.
- Shift+Right
Expands the selection one character to the right.
- Ctrl+Shift+Left
Expands the selection one word to the left.
- Ctrl+Shift+Right
Expands the selection one word to the right.
- Shift+Up
Expands the selection one line upwards.
- Shift+Down
Expands the selection one line downwards.
- Shift+Home
Expands the selection to the beginning of the current line, if not already starting or ending there. If the selection already starts or ends at the beginning, moves the start or the end to the first non-whitespace character on the line instead.
- Shift+End
Expands the selection to the end of the current line.
- Alt + any of the above
Creates a block selection instead of a regular (line-based) selection.
Block selections can also be created using the mouse, if you hold down Ctrl while making the selection.
- Shift+PgUp
Expands the selection one screen upwards.
- Shift+PgDn
Expands the selection one screen downwards.
- Shift+Ctrl+Home
Expands the selection to the beginning of the file.
- Shift+Ctrl+End
Expands the selection to the end of the file.
- Ctrl+A
Selects the entire file. If the entire file is already selected, the selection is removed instead.
- Shift+Ctrl+A
Selects the entire word.
- Ctrl+L
Selects the entire line.
- Shift + Left mouse button
(If not clicking on a selection.) Click to expand the selection to the character position where clicked.
- Left mouse button
(If not clicking on a selection.) Mouse down and move to create and expand a selection to the character position just beneath the mouse cursor.
- Ctrl + Left mouse button
(If not clicking on a selection.) Mouse down and move to create and expand a block selection to the character position just beneath the mouse cursor.
- Ruler and left-margin click
If the ruler is visible, clicking it will select the entire line. If the ruler is not visible, clicking the left half of the left text margin will do the same.
Scrolling the Window
- Alt+Left
Moves the screen scroll pos one character to the left. If the Ctrl modifier is added, the screen is scrolled a single pixel instead.
- Alt+Right
Moves the screen scroll pos one character to the right. If the Ctrl modifier is added, the screen is scrolled a single pixel instead.
- Alt+Up
Moves the screen scroll pos to the previous line. If the Ctrl modifier is added, the screen is scrolled a single pixel instead.
- Alt+Down
Moves the screen scroll pos to the next line. If the Ctrl modifier is added, the screen is scrolled a single pixel instead.
- Alt+PgUp
Moves the screen scroll pos one screen up.
- Alt+PgDn
Moves the screen scroll pos one screen down.
- Alt+Home
Moves the screen scroll pos to the beginning of the file
- Alt+End
Moves the screen scroll pos to the end of the file
- Alt + Left mouse button
Click and hold to move the screen scroll pos.
- Scroll wheel
Scrolls the document vertically.
- Shift + Scroll wheel
Scrolls the document vertically, one pixel per message.
- Scroll Lock
When activated, all mouse and keyboard commands move the screen scroll pos instead of the caret (without the need of Alt).
- Middle mouse button (wheel)
In the editor: starts panning.
Zooming the Window
- Ctrl++
Zooms in.
- Ctrl+−
Zooms out.
- Ctrl+0
Sets the zoom level to 100%.
- Ctrl + Scroll wheel
Zooms in and out.
Working with Files and Tabs
- Ctrl+N
Creates a new, empty file, in a new tab.
- Ctrl+Shift+N
Creates a new, empty file, in a new window.
- Ctrl+O
Opens an existing file in a new tab.
- Shift+Ctrl+O
Reverts the buffer to the last saved version of the file.
- Ctrl+W or Ctrl+F4
Closes the current file (and tab).
- Shift+Ctrl+W
Closes all open files (tabs).
- Shift+Ctrl+Alt+W
Closes all open files (tabs) except the current one.
- Ctrl+S
Saves the buffer to the current file, if any, or prompts for the name of a new file to save the buffer to.
- Shift+Ctrl+S
Prompts for a file name and saves the current buffer to that file.
- Ctrl+F9
Asks Windows to open the current file (the last saved version of the buffer) using the associated application.
- Shift+Ctrl+F9
Opens Windows Explorer in the folder containing the current file, and selects the file in the folder.
- Ctrl+P
Displays the Print dialog box, in order to print the buffer using a (physical or virtual) printer.
- Shift+Ctrl+Alt+X
Creates an HTML document with the current text and its formatting (due to line classes and interactive formatting (syntax highlighting)). Hint: When the export is complete, the HTML document is opened in a new tab. You may then press Ctrl+F9 to open it in the default browser.
- Ctrl+Tab or Ctrl+PgDn
Goes to the next tab (file) in the tab (file) list.
- Shift+Ctrl+Tab or Ctrl+PgUp
Goes to the previous tab (file) in the tab (file) list.
- Middle mouse button (wheel press)
On a tab: closes the tab (file).
- Ctrl+T
Duplicate buffer/tab: creates a new buffer (tab) with the text from the current buffer. The new buffer will not correspond to a file system file, will not have the history of the original buffer, and will not have the “modified” flag set.
- Shift+Ctrl+T
New buffer/tab from selection: creates a new buffer (tab) from the currently selected text. The new buffer will not correspond to a file system file, will not have the history of the original buffer, and will not have the “modified” flag set.
Find
To search the document, press Ctrl+F (for “find”) and enter the search phrase. Matches will be highlighted in the text, and you can navigate between them using F2 (previous match) and F3 (next match). Press Esc to close the search bar and set focus to the editor again; you can continue to use F2 and F3 until you modify the text in the editor.
While the caret is inside the search box, you can also go to the next match by pressing Enter and the previous match by pressing Shift+Enter (instead of F3 and F2, respectively).
To perform a Replace All operation (either in a selection or in the entire text), press Ctrl+R (for “replace”).
When the caret is inside a word, pressing Ctrl+E will search the document for it. All matches will immediately be highlighted (the view or the caret will not move). You may use F2 and F3 to go between the matches. Pressing Ctrl+E again (when the caret is inside a match) will cancel the search and remove the highlighting.
If Ctrl+E is pressed with a selection, the selected text will be search instead of the current word.
Shift+Ctrl+E works just like Ctrl+E, but will consider the underscore character (_, U+005F: LOW LINE) a part of a “word”. Hence, if the caret is found in “alpha_bet|a” at the indicated location, Ctrl+E will search for and highlight “beta” while Shift+Ctrl+E will search for and highlight “alpha_beta”.
Working with Bookmarks
- Shift+Ctrl+n (where n = 1..9)
Associates bookmark n with the current caret location.
- Ctrl+n (where n = 1..9)
Moves the caret to bookmark n.
The contextual (right-click) menu of the editor can also be used to manage bookmarks. Bookmarks are also shown in the ruler. Bookmarks work with all editor features. For instance, bookmarks are automatically updated when you use features like Sort lines, Truncate lines, Perform word wrap, Filter lines, and Make lines unique.
Multiple Carets
Rejbrand Text Editor supports a feature known as “Multiple-Caret Mode”. In this mode, you can have multiple carets in the document at the same time. When you press a character key (like A) or backspace, the appropriate action will be performed at each caret. To enter this mode, press Ctrl+M (for “multiple”); then a new caret will be created every time you click a character position in the text.
You can also enter this mode by pressing Ctrl+Up or Ctrl+Down, which will also create a new caret on the line above or below the current caret, respectively (at the same column as the current caret).
To exit the multiple caret mode, press Esc.
HTML
Have a look at the Insert/(X)HTML submenu to see the many shortcuts used to quickly insert HTML elements in the text.
Miscellaneous
- Ctrl+G
Opens the “Go To” dialog box, letting you move to a particular line number.
- Ctrl+Q
Transforms the selected text using ROT-13.
- Shift+Ctrl+U
Transforms the selected text to upper case.
- Shift+Ctrl+L
Transforms the selected text to lower case.
- F4
Shows or hides the ruler.
- F5
Inserts the current date and time at the caret, replacing any selection.
- Shift+F5
Opens the “Date and time” dialog box.
- F6
Moves the keyboard focus sequentially between different key GUI elements, such as the tab list and the editor (like in Microsoft Word). If the tab list is not visible (because there is only a single file open in the window), F6 will show it temporarily and give it focus. When the tab bar has keyboard focus, you may use the menu key to display its context menu.
- Ctrl+F6
Detaches the current tab from the current window and puts it in a new Rejbrand Text Editor window (initially alone there). The new window becomes the foreground window, so you can immediately move it to a different monitor using Shift+Win+Left or Shift+Win+Right, move it to an edge of the current monitor using Win+Left/Right, or maximize it using Win+Up.
- F7
Displays the Character window, used to find, display, and insert Unicode characters.
- Shift+F7
Copies the Unicode character information currently shown in the status bar to clipboard.
- F8
-
Displays the Character window and initiates the “Search for string...” action, so you can quickly search the Unicode database for a given character (using its description).
- F10
Enables or disables highlighting of the current line.
- F11
Enables or disables highlighting of matching brackets.
- F12
Enables or disables the visual display of invisible characters (whitespace characters).
- Ctrl+F7
Displays statistics about the file, such as the number of characters, lines, and words, the numbers of characters of different kinds, the line and word length distributions, and a list of unqique words and their frequencies, in the form of tables and graphs.
- F9
Displays the Multi-Character Input dialog box (see below).
Get Help
- F1
Displays (more or less) this help text.
- Shift+F1
Displays the list of all currently configured auto-replace codes (like \alpha for the Greek letter α; see below).
- Ctrl+F1
“Tip of the Day”: Displays small tips about using Rejbrand Text Editor.
Menu Commands
Look at the menu bar for information on commands that do not have associated keyboard shortcuts. Information about each command is displayed in the status bar.
Truncate Lines and Filter Lines
Using the “Truncate lines” feature (Edit/Truncate lines...), you can truncate all lines in the document or in the current selection at a fixed character column or at the Nth occurrence of a given character on the line, counting from the beginning or from the end of line.
Using “Filter lines” (Edit/Filter lines...), you can selectively keep or remove all lines in the text that match a given criterion.
Sorting and Wrapping
You can sort lines (Edit/Sort lines...) and make lines unique (Edit/Make lines unique). You can also perform a static, but automatic, word wrap (Edit/Perform word wrap...).
Character Find
In addition to the usual text search feature (described above), you can search your text for individual Unicode characters matching a given criterion:
Non-ASCII characters
Control characters
Noncharacters
Characters in any one of the 161 BMP Unicode blocks (such as Basic Latin, Greek and Coptic, Runic, Arrows, Mathematical Operators, or Private Use Area).
To perform a character search, use Find/Character search...
Colour Selection
Use Insert/Colour code... to display the Rejbrand Colour Selector. The chosen colour will be inserted in the text as an HTML hexadecimal colour code (#RRGGBB). If such a code is selected when you invoke the menu item, the Rejbrand Colour Selector dialog box will display this colour when opened.
Text Encodings
When opening a text file in Rejbrand Text Editor, the application will try to determine the encoding of the file.
In most cases, the application will guess the correct encoding and simply open the file. If the encoding cannot be positively determined, a dialog box will ask you for the encoding to use; the most probable candidate is selected by default, and you can preview the text in the different encodings before opening the file.
If the file is still opened using the wrong encoding, you can select a new encoding from the Encoding menu. If you choose a new encoding immediately after the file has been opened, Rejbrand Text Editor will ask you if you want to reopen the file using the newly specified encoding.
Statistics
Using Tools/Statistics (Ctrl+F7), you can display basic statistics about the current file:
The numbers of characters of different kinds: letters, digits, whitespace, and punctuation.
The line count and the distribution of line lengths.
The number of words (unique or counted with multiplicity) and the distribution of word lengths.
The list of unique words in the file and the frequency of each word.
You may specify options determining how words are extracted and compared (e.g., with or without case sensitivity). The data is presented in the form of sortable lists, tables, and graphs.
Using Tools/Advanced statistics, you get a summary of the Unicode characters present in the text. You are presented with the count of the characters in each of the 161 BMP blocks, as well as the number of control characters and noncharacters.
URLs
When right-clicking a URL, there is an option to open it. (This also works for mailto: addresses.)
Character Codes
In Rejbrand Text Editor, you can insert many non-keyboard Unicode characters by entering specific “codes”. For instance, typing \alpha followed by some punctuation mark or whitespace yields α, the Greek small letter alpha, whereas \Alpha yields the capital letter Α. In this way, all Greek letters can be inserted. But there is also support for most mathematical operators, like \cdot (⋅), \partial (∂), \int (∫), \union (∪), \deg (°), \sum (∑), \not (¬), \and (∧), \in (∈), \contains (∋), \iint (∬), \oint (∮), \coproduct (∐), \therefore (∴) etc.; many typographical characters, like \en (–), \em (—), \para (¶), \asterism (⁂), \no (№), etc.; and many other characters, like \airplane (✈), \anchor (⚓), \female (♀), \recycling (♲), \thunderstorm (☈), \warning (⚠), \wheelchair (♿) etc. In total, 370 predefined “codes” are installed by default. Press Shift+F1 to see the complete list (and their replacement texts).
The list of recognised “codes”, and their associated replacement texts (characters), can be modified to suit the personal needs of the user. To modify the list, use the tool “AutoReplace Editor” which is installed with Rejbrand Text Editor. You can start AutoReplace Editor using the Rejbrand Text Editor group on the Start menu, or you may simply run (Win+R) “AutoReplace”.
If you have an instance of Rejbrand Text Editor running while making changes to the auto-replace list (e.g., using AutoReplace Editor), the changes will be visible only to new tabs you create in Rejbrand Text Editor.
Using Options/“Auto replace”, you can toggle the auto replace feature on or off. If you have entered a code which has been replaced, and you want the code back, simply undo the replacement by pressing Ctrl+Z.
Multi-Character Input
When you have inserted the hyphen-minus character (-) in the text, you may press F9 to display a dialog box with different kinds of hyphens, minus signs, and dashes: hyphens of different line-breaking types, the minus sign, EN dash, EM dash, and so on. The character you select will replace the hyphen-minus.
When you have inserted the asterisk character (*) in the text, you may press F9 to display a dialog box with different kinds of asterisks, bullets, and points, such as typographical bullets and mathematical operators for multiplication and other binary operations. The character you select will replace the asterisk.
When you have inserted a single or double quotation mark in the text, you may press F9 to display a dialog box with other kinds of (single or double) quotation marks, including typographical quotation marks in English, German, and Swedish. The quotation mark you select will replace the one you typed initially.
In each case, you select the character you want (in the dialog box) using the arrow keys, character keys, and Enter; you may also double-click the character you want. To close the dialog box without changing the character, press Escape. (Or close it any other way you like:
Press Alt+F4.
Click the close button to the right in the title bar.
Right-click the title bar and select “Close”.
Press Alt+Space to show the system menu, and press Up, Enter or type the accelerator of the Close menu item.
Send a
WM_CLOSE
message to the dialog window (HWND).)
For instance, typing ", F9, R, Enter, will insert ” (U+201D: RIGHT DOUBLE QUOTATION MARK).
Hint: You may also use character codes to insert different characters related to hyphen-minus and the asterisk. For example:
\minus gives − (U+2212: MINUS SIGN)
\en gives – (U+2013: EN DASH)
\em gives — (U+2014: EM DASH)
\bullet gives • (U+2022: BULLET)
\cdot gives ⋅ (U+22C5: DOT OPERATOR)
\times gives × (U+00D7: MULTIPLICATION SIGN)
Drag and Drop
Rejbrand Text Editor supports OLE drag and drop. Consequently, you may not only perform drag and drop operations inside Rejbrand Text Editor, but you may also drag text to and from other compatible software, for instance to and from Microsoft Word or from your web browser (or to an edit field in it). Typically, an ordinary drag and drop operation will move the text (if the source is not read-only), while the addition of the Ctrl key will cause the selection to be copied instead of moved. Rejbrand Text Editor will display a context menu if you right-drag a selection in or to it (just like Windows Explorer and Microsoft Office).
You may also drag and drop tabs to reorder them within a single Rejbrand Text Editor window or to move them between different Rejbrand Text Editor windows. If you drag a tab to a Rejbrand Text Editor window frame (instead of to a specific location within its tab list), the tab will be appended to the tab list (that is, placed at the very end of the tab list).
Command-Line Arguments
You may start Rejbrand Text Editor with a list of files to open; each file will be opened in a tab of its own. For each file, you may specify options determining how the file will be opened; you do this by specifying flags after the file name. The following flags are supported:
-
/L:n (n is an integer)
Will go to the beginning of a specific line in the file. If n ≥ 1, the caret will be placed at the beginning of line n from the top; if n ≤ −1, the caret will be placed at the beginning of line |n| from the end. (If n = 0, the flag is ignored.)
Examples:
- /L:5 (places the caret at the beginning of the fifth line from the top)
- /L:-1 (places the caret at the beginning of the last line in the file)
-
/F:str (str is a string)
Will search for the text str in the file. If the search string contains whitespace, it must be quoted (placed between " and "). Matches will be highlighted and you may navigate between them using F2 and F3 (this is an ordinary text search operation). The caret will be placed at the beginning of the first match in the file if not the /L flag is present. If the /L flag is present, the caret will be placed at the beginning of the first match after the caret position specified by the /L flag.
Examples:
- /F:function (searches for “function”)
- /F:"et cetera" (searches for “et cetera”)
Search options can be specified using the following flags.
-
/C
If present, the search operation specified by the /F flag will be performed in a case-sensitive manner.
-
/W
If present, the search operation specified by the /F flag will use the “match whole words” option.
-
/EOF
If present, the caret is unconditionally placed at the end of file (EOF) after the file has been opened. This contrasts with the default behaviour, in which the caret is placed at the beginning of the file (SOF). This option overrides /L. If the /F flag is specified, /EOF will also prevent the caret from being placed at the first match. Matches will still be highlighted and it will still be possible to jump between them using F2 and F3.
-
/SOF
If present, the caret is placed at the beginning of the file (SOF) after the file has been opened, even if /L or /F is present. Hence, /F and /SOF can be combined to initiate a text search operation without going to the first match. Matches will still be highlighted and it will still be possible to jump between them using F2 and F3. /SOF has no effect if /EOF is present.
-
/R
Will open the file in read-only mode. (If /R is not present, the file might still be opened in read-only mode if the file’s extension is in the list of read-only file types.)
Examples:
-
rteditor novel.txt /F:auto
This will open novel.txt and search for “auto” case insensitively. Matches will be highlighted and you can navigate between them using F2 and F3. Initially, the caret will be placed at the beginning of the first match in the file.
-
rteditor "C:\file.txt" "C:\code.pas" /L:50 "C:\words.txt" /F:self /W /SOF
This will open three files:
- file.txt (opened normally; no search operation and caret initially at SOF)
- code.pas (caret will be placed at the beginning of line 50 from the top)
- words.txt (will search for the word “self”; matches will be highlighted but the caret will not be placed at the first match, but will remain at SOF)
-
rteditor "C:\code.pas" /L:-100 /F:"function parse"
This will open code.pas, search for the text “function parse”, and place the caret at the beginning of the first match within the last 100 lines of the file.
-
rteditor log.txt /EOF
This will open log.txt and place the caret at the end of the file.
-
rteditor certificate.txt /R
This will open certificate.txt in read-only mode.
Known Limitations
Currently, Rejbrand Text Editor only supports Unicode characters within the Basic Multilingual Plane (BMP).
Rejbrand Text Editor does not combine Unicode codepoints. This is a limitation, but also a feature, since it enables an easy and technical way to author, edit, and review texts with combining characters, with little to no risk of confusion.
Additional Help
If you need additional assistance, please write an e-mail to the software developer at andreas@rejbrand.se. Also, if you find a bug (no matter how “small”) or have any suggestions, please write a letter.
If you are writing in Swedish, you should also have a look at Språkvård and semikolon.info.