Notepad2e
Word highlighting, simultaneous editing, split views, math evaluation, un/grep, comment reformatting, UAC elevation, complete regexps (PCRE), Lua lexers, DPI awareness and more (XP+)
Install / Use
/learn @ProgerXP/Notepad2eREADME
Notepad 2e
Notepad 2e is a fork of Notepad2 by Florian Balmer (www.flos-freeware.ch), version 4.2.25.
For information about the original project please see Readme.txt and Notepad2.txt.
This document describes 2e-specific features (e for Extended).
For those of you who are unfamiliar with Notepad2:
Notepad2 is a light-weight Scintilla-based text editor for Windows. <br> It offers no tabs, code folding, autocompletion, or other features <br> available in IDEs or more complex editors like Notepad++. <br> It's just 1 portable EXE file and (optionally) 1 INI file.
Some folks use it to replace the standard Notepad.exe of Windows.
It's also part of TortoiseGit.
License: Notepad2 uses 3-clause BSD license. Notepad 2e follows the same license.
Thanks to Steven Penny for his generous donations! #286 #251 <a name="thanks"></a>
Downloads
Stable versions are available via GitHub releases.
Archived non-stable daily builds are available from this page.
Latest non-stable x86/non-ICU build is permanently available by this URL.
Compilation
- Prepare Boost environment.
- you will get
libboost_regex-vc141-mt-s-x32-1_68.lib,libboost_regex-vc141-mt-s-x64-1_68.libin%BOOST_ROOT%\stage\lib
- you will get
- If you are going to build ICU configurations, prepare ICU too. #162
- you will get the 2 Boost libraries above in
%BOOST_ROOT_ICU%\stage\liband alsoicuregex64.lib,icuregex86.lib
- you will get the 2 Boost libraries above in
- The project comes with a "hacked" Scintilla; if you wish to use the original Scintilla, read this changelog.
- To compile the sources, use Visual Studio 2015 or 2017. #178
- To run tests (
Notepad2eTests), pointFileSamplesPathenvironment variable to the...\test\data\Extensiondirectory. #178
Note: x64 configuration is not considered "mainstream" and was poorly tested. #157
Replacing Windows (XP/7/10) Notepad
One obvious way is to overwrite all Notepad.exes inside Windows directory. However, this irritates SFC and may not persist across OS updates.
A better way is using Image File Execution Options, originally explained here. In short: #157
- Place
Notepad2e.exesomewhere.Program Files (x86)\Notepad2e\directory is a good place. - Import this registry key:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
"Debugger"="\"C:\\Program Files (x86)\\Notepad2e\\Notepad2e.exe\" /z"
- If the EXE was put elsewhere, edit the part inside the second quotes, and don't forget to double all backslashes - example:
...="\"D:\\Foo\\Bar\\MyN2e.exe\" /z" - Attention: the EXE should not be named
notepad.exe(in any char case).
Now whenever Windows needs to launch Notepad.exe it will launch the EXE you have specified instead.
To undo, replace last line above with "Debugger"=- and import the key.
INI File Location
This describes the algorithm used in Notepad2 and this fork. The process is fully Unicode-safe.
All settings are stored in a single INI file. If the program cannot find it, then default settings are used and changes to them are lost when the process exits. To make settings persistent, either put bin\Notepad2e.ini near the EXE or create one from scratch by pressing F7 (Settings > Save Settings Now).
The following locations are checked for an existing INI file, in order:
/f SOME.INIcommand-line switch (relative to program's dir, with possible%env%vars)./f0forces no INI file even when explicitly asked for one (e.g. by F7).PROGRAM.ini, wherePROGRAMis the EXE's name without.exeextension, is searched in:- Program's directory
%APPDATA%%PATH%
- Same as above but with
Notepad2.ini(Notepad 2e is a drop-in replacement so its INI file works with Notepad2 and vice-versa). - If an INI was found, it may be further redirected: its
Notepad2.inikey from[Notepad2]section is read and checked:- If this key is non-existing or blank, the previously found INI is used
- Else, if the value is an absolute path (
%env%vars expanded) to an existing file - it's used as the INI - Else, if the path is relative (
%env%vars expanded) - it's searched in the same folders asPROGRAM.ini(above) and used, if found - Else, if the key was not blank and no INI was found - the value is used as the (new, non-existing) INI file path (prepended with program's directory if relative)
If the located INI path (PATH below) is a directory rather than a file or it ends with \ then:
- If
PATH\PROGRAM.iniexists, it's used as the INI file - Else, if
PATH\Notepad2.iniexists, it's used as the INI file - Else,
PATH\PROGRAM.iniis used anyway
Finally, if the INI's parent directory doesn't exist - it's created.
Extended Edition Changes
The [NEW] mark indicates a new major feature introduced by Notepad 2e. Items without this mark are changes (or minor features added) compared to the original Notepad2.
Marks of this form: #123 refer to specific issues - read them for more details behind a feature.
Notepad2 has no documentation per se but only this FAQ that explains many interesting features.
[NEW] Current Word Highlighting
Word under cursor is highlighted in one of 3 modes: #27 #1
- One occurrence in the document. Indispensable to spot typos.
- Two or more occurrences but all are visible on the screen.
- Multiple occurrences with some hidden under the scrollbar.
Warning: when word wrapping is enabled, highlighting assumes that entire bottom line is visible even if it has invisible sublines (wrapped continuations).
Related settings:
HighlightSelectionMaxSearchDistance- More - see Current Word Highlighting configuration section.

[NEW] Edit Selection
Allows simultaneous editing of all occurrences of the same string as the selection. Enter the mode with Ctrl+Tab (all visible substrings) or Ctrl+Backtick (limit substrings to those on the same line). Escape cancels all changes, while Enter or any command that causes cursor to leave the selected block - commits them. #18
Note: when selection is empty, this mode affects word near the cursor, and finds other substrings case-insensitively. When selection is non-empty - case-sensitive search is performed, and word boundaries are not checked.
This mode allows easy renaming of variables, typo corrections and so on.
Below, with cursor within foo pressing Ctrl+Tab will enter this mode and any change you do (such as typing bar) will edit all of the three foos at the same time:
$foo = "foo";
print($foo);
Warning: when word wrapping is enabled, highlighting assumes that entire bottom line is visible even if it has invisible sublines (wrapped continuations), thus you might be editing occurrences on those sublines without seeing them.
Related settings:
- See Current Word Highlighting section (above).

[NEW] Math Evaluation
In certain cases (such as in current selection), the file size group in the status bar is replaced with a recognized math expression's result. Left-click on the group copies result to the clipboard (as it appears), right-click toggles the base (bin, oct, dec, hex). #261
- Selection must be shorter than 4096 symbols.
- Evaluation can be restricted to a rectangular selection (Alt+drag). #242
- Expression is locale-insensitive and follows English conventions so that comma is a thousands separator (and ignored) and period is a decimal part separator.
- If expression has commas but no periods and is still valid after replacing commas with periods - then the converted version is evaluated:
12,30 + ,1= 12.40. This allows more resistance to locale-specific delimiters. - If result has no fractional part - period and zeros are hidden from the status bar group. Fractional part is discarded if active base is any but decimal.
- The following symbols are ignored:
, $. Whitespace is ignored unless it separates operands/operators. - If expression contains
=then the=and everything after it is ignored. Useful for checking calculations:1+2=4evaluates to 3. - Special case: expression with only digits (including hex), radix prefix/suffixes, periods and any ignored symbols (above) is treated as a series of whitespace-separated numbers, which are summed up. For example:
12,3 45.6 $78 10h=123+45.6+78+16= 262.6. #72- Attention: don't use
esymbol by itself in this special case (as in scientific notation or as a const), e.g.1e2or1 e 2- due to implementation nuances, it may not be processed as expect. But it can be part of a hex number:eh 0xe= 28. #130
- Attention: don't use
The following expression tokens are recognized:
- operators:
( ) + - * / ^(caret works as power) - opera
