Updates for Notepad2 5.0.26-beta4

Notepad2 ― Frequently Asked Questions (FAQs)

Will Notepad2 ever have a tabbed multiple document interface?

Personally, I prefer the true Notepad-like single document interface for my daily work with small scripts and files. As this is by far the most frequently asked question, here's a few more arguments to confirm my (of course subjective) point of view:

So I'm sorry I can't promise I will ever work on a tabbed multiple document interface for Notepad2.

What new features are planned for the next version of Notepad2?

At the moment, Notepad2 does most of the things I want it to do, so don't expect breaking news in the next time. I might one day think of adding the features listed below:

The following features are beyond my personal design goal of a simple Notepad-like application, so it's unlikely I will ever be working on them:

Why not adding automatic source code formatting?

Automatic source code formatting may be something very handy, of course. But adding this to Notepad2 would mean a lot of extra effort on incorporating and maintaining the required libraries, and this would increase the size of the Notepad2 executable file. Also, to be complete, this would have to be offered for any syntax scheme supported by Notepad2. And, a big deal of additional user interfaces might be necessary to make the many options of the source code formatters available to the user.

My philosophy is to use simple, small and fast external tools for this purpose. I'm using HTML Tidy to pretty print my html source from the "Open with..." dialog of Notepad2 (using a batch file to specify a configuration file with the HTML Tidy options). Other source code formatters, such as Artistic Style for C, C++, C# and Java, are also available as command line tools, and can easily be used from within Notepad2.

How do I set a default file extension?

The default extension for saved files can be specified in the Notepad2 ini-file, this is explained below.

How do I change the default font?

View, Default Font (Alt+F12).

Why are there different text widths with monospace fonts?

By default, Notepad2 sets the bold font attribute for certain styles (mostly keywords or reserved words of a programming language). Not all monospace fonts use identical widths for bold and regular text. To fix this, either clear the bold font attribute from the affected styles, or use a default font that has identical widths for bold and regular text, such as "Consolas" or "Courier New".

How do I change the appearance of the line numbers?

Go to the Customize Schemes dialog (Ctrl+F12), unfold the Default Text node, and modify the Margins and Line Numbers item (set foreground and background colors, and font name, size and style).

How can I turn off font smoothing (anti-aliasing)?

From Notepad2 version 4.1.24, there's a new style setting to control smoothing of font edges (anti-aliasing), that can be set for the Default Style and 2nd Default Style items, and is valid globally for all other styles (see screenshot).

The smoothing option can be set to either of the following values:

none
Disable font smoothing (can be preferred for certain fixed-width fonts).
standard
Enable standard font smoothing (introduced with Windows 9x).
cleartype
Enable ClearType smoothing (optimized for LCD displays).
default
Use the system default font smoothing method.

Note that this setting only takes effect if the appropriate anti-aliasing method is available and activated on your system. Direct2D mode as a special case may not support all methods, either. Usually, only screen display (and not printing) is affected by font smoothing. If not specified otherwise, Notepad2 uses the system default font smoothing method, but tries to enforce ClearType rendering for some fonts introduced with recent versions of Windows and Microsoft Office (Calibri, Cambria, Candara, Consolas, Constantia, Corbel, and Segoe UI).

Where's the Fixedsys font gone?

As of version 5.0, Notepad2 uses Direct2D and DirectWrite instead of Windows GDI for drawing on Windows Vista or newer. The Fixedsys font may no longer be supported by Direct2D, and may be substituted by another fixed-width font. If you'd like to stick to the Fixedsys font, you may need to disable Direct2D, as explained in the section about advanced program settings.

What's the advantages of using Direct2D and DirectWrite?

Direct2D and DirectWrite are significantly faster than the traditional Windows GDI, as graphics calculations are outsourced to the graphics processing unit (GPU) of the video card. By ways of sub-pixel rendering, font smoothing looks better, and font linking ensures all glyphs are properly displayed, i.e. Far East characters will no longer appear as squares or questions marks, if a certain font does not support them (yet this technique may also affect the display of adjacent characters, as font linking is not performed on a per-character basis).

How to change the appearance of the caret (cursor)?

Go to the Customize Schemes dialog (Ctrl+F12) and unfold the Default Text node. Modify the Caret (Color, Size 1-3) item to change the caret color and shape (valid entries are size:1, 2, 3 or block). Add noblink to stop the caret blinking.

As of version 5.0, Notepad2 uses Direct2D and DirectWrite instead of Windows GDI for drawing on Windows Vista or newer. There have been reports of the caret randomly disappearing on Vista in Direct2D mode, probably due to some issue with subpixel rendering on this platform with small caret sizes. Setting a wider (or block) caret as outlined above may help, alternatively Direct2D mode can be disabled, as explained in the section about advanced program settings.

Is there a way to reduce line spacing?

The line height is determined by the tallest items, namely Matching Braces and Matching Braces Error, by default. Adapt their size to reduce line spacing to default values, as in this screenshot.

As of version 4.0, you may also need to reset the Extra Line Spacing setting to restore default line spacing.

How to stop the text selection from extending beyond the end of lines?

Open the Customize Schemes dialog (Ctrl+F12), unfold the Default Text node and find the Selected Text item, then remove the eolfilled attribute.

Can't I hide the control characters?

No, the control characters (NUL, ACK, BEL, etc.) can't be hidden, but the size can be reduced: open the Customize Schemes dialog (Ctrl+F12), unfold the Default Text node, find the Control Characters (Font) item, and modify the size property.

How do I select the proper character set?

Select the character set (script) matching your local encoding from the font dialog, as in this screenshot. Alternatively, the character set can be entered manually, but only for the Default Style and 2nd Default Style items, as demonstrated in this screenshot.

Note that this option only affects (system default) ANSI mode. For any other encoding, the Scintilla editing control internally works in UTF-8 mode, and there's no ambiguities which glyph should be used to display a certain code point.

Is it possible to convert text from ANSI to Unicode and UTF-8?

Proper text conversion is performed when switching to a new encoding (File, Encoding). However, this action will clear the editor undo history. When converting from Unicode and UTF-8 back to ANSI, non-supported characters will be replaced by default values (usually ?).

Why are my UTF-8 files loaded as ANSI?

The ANSI and UTF-8 encodings share the common 7-bit ASCII subset. A file without any extended characters (ä, é, õ) will be loaded as ANSI by default.

To ensure a file is loaded as UTF-8, either use the UTF-8 signature (which has been invented for this purpose), or add some comments with extended characters to your file. Or, you could set UTF-8 as the default encoding (File, Encoding, Default), this will load ASCII files - but also new and zero-byte files - in UTF-8 mode.

The default settings dialog box has an option to preferably load ASCII files as UTF-8, even if UTF-8 is not set as the default. This option is temporarily enabled when reloading the current file using Shift+F8.

To reload a file in default ANSI mode bypassing encoding detection, press Ctrl+Shift+A.

Why are my text files sometimes garbled?

Unicode detection may fail on some systems and result in display of non-Unicode text as garbled Unicode text. The Notepad2 statusbar usually indicates Unicode for such cases, indicating no BOM was present in the file, and the encoding was guessed. To skip automatic Unicode detection (and just rely on BOMs for Unicode file identification), enable the appropriate option (File, Encoding, Default). This will not affect UTF-8 detection.

Another reason for garbled text may be that the current font does not support all the necessary glyphs required for proper display. To check this, choose another default font (Alt+F12), preferably a general-purpose typeface like "Arial" or "Arial Unicode MS".

Why is the text sometimes messed up on copy and paste?

When working in ANSI mode and setting a character set (script) that does not correspond to your system default ANSI encoding, text may be converted improperly when copying to and pasting from clipboard, in some cases.

Also, pasting Unicode characters while in ANSI mode causes non-supported characters to be replaced by default values (usually ?).

This can be fixed by explicitly setting the desired ANSI encoding as the default, i.e. if your system default ANSI code page is 1252, set Windows-1252 instead of ANSI (1252) as your default. This enforces UTF-8 mode, internally, and ensures proper encoding conversion for copy and paste operations.

And why is the text sometimes clipped on copy and paste?

The Windows clipboard interprets NULL bytes as text end markers. The Scintilla source code editing component is capable of displaying NULL bytes, but copy and paste operations will not work properly due to the Windows clipboard specifications.

Note: to find an replace NULL bytes, use the term \x00 and activate Regular expression search.

How can I edit MS-DOS (OEM) text files?

This is explained in the Notepad2 Encoding Tutorial.

Does Notepad2 support ISO encodings?

As of version 4.0, Notepad2 supports some of the ISO encodings. Details can be found in the Notepad2 Encoding Tutorial.

What about bidirectional text support?

Currently, bidirectional (right-to-left) text, such as Arabic, Hebrew and others, is not supported by Notepad2. Adding this feature would require modification of the Scintilla editing component.

How can I save a file that requires Administrator privileges?

The following steps are recommended:

There may be an easier way to save files with Administrator privileges. The principle of this method would be to create a temporary file, and then use a Win32 API file operation function with partial UAC elevation support to copy the temporary file over the original. However, this would break hardlinks, so that's why it's a design decision not to implement this method in Notepad2.

Why are binary files sometimes modified when saving?

Apparently random changes (even without any modifications by the user) may be caused by the two options to ensure consistent line endings and to strip trailing blanks when saving. These options can be disabled in the File, Line Endings, Default dialog box.

Notepad2 has not been designed to handle binary files, and many editing operations, including copying to and pasting from clipboard, will not work properly. I recommend using one of the numerous excellent free hex editors for Windows, instead.

Why is virtual space not enabled in Notepad2?

Virtual space is space beyond the end of each line. The Scintilla editing component used by Notepad2 supports this feature, to simplify caret navigation and rectangular text selection. However, enabling virtual space in Notepad2 would cause some inconsistencies with existing Notepad2 functionality, that's why it's a design decision to keep virtual space disabled, for now.

The "Pad with Spaces" command (Alt+B), to work either without selection (on the whole file), with a normal or a rectangular selection, can be used to insert padding spaces, allowing caret navigation and rectangular text selection similar as with virtual space. Padding spaces no longer used can be removed with the "Strip Trailing Blanks" command (Alt+W).

What's the problem with long lines?

Notepad2 is based on the Scintilla editing component, which has not been designed to handle text with very long lines. Source code editing with usual line lengths works perfectly.

Why is Notepad2 sometimes slow?

Same answer as above: Notepad2 is based on the Scintilla editing component, which has been designed to work with usual source code files. Working with large files or very long lines, especially when using find and replace operations, may reduce Notepad2 performance.

In some cases, find and replace operations can be terribly slow, even if not used on overlong lines. This seems to happen mostly in ANSI mode if the system default ANSI code page belongs to the DBCS family, but does not occur on every system. Explicitly setting the default encoding to a Windows encoding, instead of ANSI, can sometimes improve search speed, i.e. if your system default ANSI code page is 1258, set Windows-1258 instead of ANSI (1258) as your default.

Why is the horizontal scrollbar not calculated properly?

As one single line may contain many different syntax styles, proper line length calculation requires high performance. For this reason, a fixed width is assumed. The end of long lines can always be reached using the End key or the scrollbar arrows.

Why does the Title Case function sometimes not work as expected?

On Windows 7 and above, Notepad2 utilizes a system function to convert text to title case. Depending on your computer's regional settings, the system function may not change words already starting with or containing one or more upper case letters. The workaround is to convert text to lower case, before using the Title Case function.

Is text search always case sensitive?

The most recent versions of the Scintilla source code editing component support case insensitive search for non-ASCII characters. This feature is available in Notepad2 4.2 and above.

However, this does not apply to regular expression search: extended characters, which are not part of the basic ASCII character set, are always treated case sensitive.

Can I do multiline find and replace?

This is possible when activating the Transform backslashes option in the find and replace dialog boxes. Enter \n to represent the LF character, or \r for the CR. If line ending mode is set to Windows (CR+LF), \r\n has to be used to represent newline sequences.

To perform a replacement operation with multiline text as the replacement, it's easier to copy the text to the clipboard first, and then use ^c as a placeholder for the clipboard contents in the replacement field.

How to find and replace tab characters?

If you activate Regular expression search in the find and replace dialog boxes, the \t sequence represents a tab character both in the find and in the replace text.

How to use regular expression search in Notepad2?

This is explained in the Notepad2 Readme File: Notepad2.txt.

Notepad2 supports only a limited subset of regular expressions, as provided by built-in engine of the Scintilla source code editing component. The advantage is that it has a very small footprint. There's currently no plans to integrate a more advanced regular expressions engine, but this may be an option for future development.

Note: Regular expression search is limited to single lines, only.

Why is there only rudimentary regular expressions support in Notepad2?

Notepad2 uses the limited, but lightning-fast and tiny-footprint regular expressions engine built-in to the Scintilla editing component. Switching to a more advanced engine, such as PCRE or similar, would increase the complexity of the Notepad2 source code, and the size of the executable file. It's a design decision that the advantages do not outweigh the disadvantages explained here, but this will be reevaluated for future development

How to use basic Emacs file variables?

Notepad2 can parse a few of the Emacs variables that can be used in source code files. The first 512 bytes of a file (and, if nothing is found, also the last 512 bytes) are checked for the following constructs (can be manually disabled in the ini-file, or the File, Encoding, Default dialog box, respectively):

coding: utf-8;
mode: python;
tab-width: 8;
c-basic-indent: 2;
indent-tabs-mode: nil;
c-tab-always-indent: true;
fill-column: 64;
truncate-lines: false;
enable-local-variables: true;
coding
Serves as a file encoding tag. Details about using encoding tags are outlined in the Notepad2 Encoding Tutorial.
mode
Indicates the syntax scheme to be used, and is either the name of a scheme, or a file name extension.
tab-width
c-basic-indent
Denote tab and indentation settings.
indent-tabs-mode
Determines whether to insert tabs as spaces (nil, false or 0) or not (true or 1).
c-tab-always-indent
Configures whether the tab key reformats indenting whitespace (true or 1) or not (nil, false or 0).
fill-column
Sets the desired limit for long lines (but does not automatically display the visual marker).
truncate-lines
Controls word wrap (enable: nil, false or 0; disable: true or 1).
enable-local-variables
Disables file variable parsing (nil, false or 0), but keeps evaluating encoding tags. To bypass both file variable and encoding tag parsing, reload the file with Alt+F8. Adapt the settings mentioned above to permanently turn off file variables and encoding tags.

How to update timestamps in the text?

Press Shift+F5 to execute a regular expression replacement macro defined in the Notepad2 ini-file. The example below updates CVS-like timestamps:

[Settings2]
...
TimeStamp=\$Date:[^\$]+\$ | $Date: %Y/%m/%d %H:%M:%S $

How to rebuild Notepad2 from the source code?

Refer to the Readme.txt file included in the Notepad2 source zip for more information.

Could you please explain how to add or modify syntax schemes?

Refer to the Readme.txt file included in the Notepad2 source zip for more information.

How can I use ASP VBScript highlighting?

VBScript highlighting inside ASP files is triggered by the following statement:

<%@ Language=VBScript %>

How to set Notepad2 as the IE source viewer?

Find the following registry key (create if necessary):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name

Set the default value to the full path of Notepad2.exe.

Update: With IE8, press F12 to open the Developer Tools, select File, Customize View Source, and find Notepad2.exe.

Is there a way to pass short filenames to external tools?

This can be achieved using the for command in a batch script:

for %%i in %1 do echo %%~si

How can I open multiple Notepad2 windows?

Either disable the Reuse Window option from the Settings menu, or run Notepad2.exe with the /n command line switch to allow multiple windows.

To simultaneously open multiple files in new windows from the command line, use the + command line switch:

notepad2.exe + file1.txt file2.txt

Why does opening multiple windows sometimes fail?

If Notepad2.exe is run via a hotkey assigned to a desktop shortcut, the OS will take over instance management, and activate an already existing Notepad2 window, even if the /n command line switch has been added to the desktop shortcut command line.

How to display a file with a certain syntax scheme?

Run Notepad2.exe with the /s command line switch and specify a partial syntax scheme name, or a file name extension that has been associated with a syntax scheme in the Scheme Customization dialog. The following examples display an Apache configuration file with standard configuration file highlighting:

Notepad2.exe /s ini file.conf
Notepad2.exe /s "Configuration Files" file.conf

The following shortcut switches can be used to directly select common syntax schemes: /d (Default Text), /h (Web Source Code) and /x (XML Document).

How to jump to a specified position when a file is opened?

Use the /g command line switch to specify a line, and optionally a column, to jump to:

Notepad2.exe /g 10,5 file.txt

The following command can be used to jump to the end of a file:

Notepad2.exe /g -1 file.txt

To jump to a specified text passage, use the /m option. There's optional modifiers to match the last occurrence (/m-), use regular expression search (/mr) or backslash substitution (/mb). The last two modifiers are exclusive, and it's not possible to match double quotes (as these are used to separate command line arguments).

Use something like this to jump to the last entry of a log file:

Notepad2.exe /mr- "\d\d\d\d-\d\d-\d\d:" file.txt

Any way to make the toolbar buttons look more distinct?

The Notepad2.ini file included in the Notepad2 zip file has some options to display text descriptions near the toolbar button images, or to use custom toolbar images. Requires a restart of Notepad2.

Why is editing large files in Notepad2 discouraged?

As a general consideration, Notepad2 is keeping a copy of the whole file being edited in memory, as this is necessary to perform proper syntax highlighting (i.e. comments or strings may span over arbitrary lengths). Besides the bytes representing the text, Notepad2 also consumes memory for syntax styling information, undo and redo history, and encoding conversion.

As of Notepad2 version 5.0, any text file is internally converted to UTF-8, and for the sake of speed, this operation is performed with memory chunks usually exceeding (!) the file size. This explains the need for a lot of extra memory when loading and saving files. Notepad2 should warn you if there's not enough free memory when loading or saving a file, and not do anything harmful to the file.

With large files being edited and many editing operations accumulating in the undo and redo history, the Scintilla editing component may run out of memory, and not allow any more user actions. In this case, it's usually not possible to save the file, as this would require even more memory. There should be no damage to the underlying original file, but the performed changes stored in memory are likely to be lost, as there's usually not enough free memory to copy the text to clipboard, either (the Windows clipboard accepts data as UTF-16, and Scintilla works with UTF-8, so the required encoding conversion would feed up additional space). To be on the safe side, it's recommended to only edit files smaller than 100 megabytes in Notepad2 (the limit on x64 platforms may be somewhat higher, as Notepad2 may be able to allocate larger memory chunks here), and save and reload files from disk from time to time to clear the undo and redo history, especially if many complex operations have been performed.

Of course Notepad2 could be optimized to perform encoding conversion with smaller memory chunks, but this would be of no help regarding memory consumption of syntax styling information, and undo and redo history. So it's a design decision for now that Notepad2 is not intended to edit large files. Even modern web browsers are terribly slow with large (plain text) files (even on ultra-fast machines), so large files are better be split into smaller parts, even more if editing with an agile Notepad-like editor is desired.

How to disable the large file warning message?

The large file warning message dialog provides an option not to be displayed any more. Or you could adjust the size limit for when the warning is triggered: add the value FileLoadWarningMB to the [Settings2] section of the Notepad2 ini-file, and assign it the size in megabytes.

As of Notepad2 version 5.0, the large file warning message always appears when loading files of a size exceeding 64 megabytes, regardless of the settings explained above.

Notepad2 needs to keep the whole file in memory (to be able to perform syntax highlighting), and also requires additional memory to store undo history, perform encoding conversion on saving, etc. That's why editing very big files can lead to memory exhaustion, and possible loss of data.

Why is there a security warning when running Notepad2?

If the Notepad2 zip file is downloaded with Internet Explorer, the file is labeled to be insecure, as it origins from the web. Some unzip tools may also add this label for extracted files, and this may cause a security warning when running Notepad2.

To remove this warning message, right-click the Notepad2.exe file in Explorer, choose Properties from the context menu, and press the Unblock button at the bottom of the General tab. Confirm this action with the OK button.

Why are some menu items disabled (grayed)?

If no existing ini-file is found, Notepad2 will not create one, unless the settings are saved manually (F7). Also see the topic Why are my program settings not saved at all? below.

If there's no ini-file Notepad2 can use, some functionality, such as saving a sticky window position, remembering recent files and search strings, saving settings on exit, or running Notepad2 in reuse window and single file instance modes, are not available, and therefore the appropriate menu items will be disabled.

Note that the functionality mentioned above is also disabled when running Notepad2.exe with the /f0 command line switch.

Why are my program settings not saved at all?

As of version 3.1, Notepad2 will no longer create a default ini-file in the program directory. If no existing ini-file is found, you need to manually save the settings (F7) the first time. From now, the program settings are saved to the newly created ini-file.

Furthermore, Notepad2 requires write access to the ini-file to be able to save the program settings. If settings are saved manually (F7), a warning message appears if the ini-file is write-protected. However, on exit, no warning is issued, as setting the read-only flag of the ini-file can be used to freeze the settings.

On Vista and above, Notepad2 is not allowed to write files inside the %PROGRAMFILES% directory tree, by default. You need to move the Notepad2.ini file to your %APPDATA% directory (type %APPDATA% into the Windows Explorer address bar to locate it), or manually edit the Notepad2.ini file inside the program directory (requires elevated privileges) and add the following text right at the top:

[Notepad2]
Notepad2.ini=%APPDATA%\Notepad2.ini

This will move the Notepad2.ini file to your user profile directory.

Why are some settings not saved properly?

As of version 3.0 and above, the Notepad2 settings are stored in Unicode format. If you are reusing your ini-file from previous versions, it is still encoded in your local system encoding. This causes some settings to be saved improperly (recent files with Unicode names, Unicode search strings, Unicode font names).

To fix this, open the Notepad2 ini-file (Ctrl+F7), convert it to Unicode (File, Encoding, Unicode), and save it.

You could also reuse your ini-file with the earlier non-Unicode encoding, this would save a few KB of disk space. But in this case, you won't be able to save Unicode data (items mentioned above).

A new ini-file is always created in Unicode format.

Where is the Notepad2 ini-file located?

Notepad2 first tries to find the ini-file with the same name as the executable file, and then the file Notepad2.ini. The program directory is the primarily searched location, followed by the %APPDATA% folder, and then the directories specified by the %PATH% environment variable and the Windows directory.

By default, if no existing configuration file is found with the above rules, the ini-file location is set to the Notepad2 program directory, and the the name of the executable file is used. However, the ini-file will only be created if the settings are saved manually (F7).

If a relative file name is specified on the command line as an alternative location of the ini-file, the same rules apply (use something like Notepad2.exe /f "%APPDATA%\MySettings.ini" to save the ini-file to a certain directory, or just Notepad2.exe /f "%APPDATA%").

How to use separate ini-files for each user?

To let each user on your system have his own Notepad2 configuration, create one central Notepad2.ini file (or an ini-file with the same name as the Notepad2 executable file), either in the Notepad2 program directory, or in the Windows directory (the latter method is preferred if multiple copies of the executable file are present on your system). Now insert something like the following configuration section into the central ini-file:

[Notepad2]
Notepad2.ini=%WINDIR%\Notepad2-%USERNAME%.ini

This will create a separate file named Notepad2-userxy.ini in the Windows directory for each user. To have the ini-file stored in the user profile instead of the Windows directory, use something like this:

[Notepad2]
Notepad2.ini=%APPDATA%\Notepad2.ini

If a relative pathname is specified, it is again searched with the rules outlined in the previous question.

How to import and export syntax scheme settings?

The custom configuration of the syntax schemes can be imported and exported from the Customize Schemes dialog: just use the appropriate buttons if the dialog box is displayed (Ctrl+F12). Note that when settings are being imported, missing sections of the ini-file will be skipped and won't restore the default settings, so it's possible to import ini-files containing just selected scheme settings.

How to reset the Notepad2 notification messages?

To bring back the notification messages suppressed with the "Don't display this message again" option, load the ini-file (Ctrl+F7) and delete all the values from the [Suppressed Messages] section.

To block the "Don't display this message again" option for an individual notification, set the value of the corresponding ini-option to 2. For example, MsgNotFound=2 ensures the "Text not found" notification message will always be displayed.

What about the [Settings2] section of the ini-file?

You may have noticed that the Notepad2 ini-file has a configuration section named [Settings2]. This section offers some advanced Notepad2 program settings, and can only be edited manually. Press Ctrl+F7 to open the Notepad2 ini-file. Most changes only take effect upon restarting Notepad2.

StickyWindowPosition
ReuseWindow
SingleFileInstance
These items are managed by Notepad2.
MultiFileArg
Control if Notepad2 should allow multiple files on the command line (set to 1). The default behaviour is to accept only a single file, without quoted spaces, like Windows Notepad (set to 0). The command line switches + and - can be used to override this setting on the fly, and the /z switch has the same effect as the - switch.
OffsetNewWindows
Determines whether positions of new windows (opened though Alt+N or Alt+0) should be offset relative to the active Notepad2 window (1). The new default setting for Notepad2 5.0 is to use the same window position as the currently active Notepad2 window (0).
SharedMRU
This option controls whether Most Recently Used (MRU) lists for files and search strings should be shared across all running instances of Notepad2. This is the new default behaviour for Notepad2 5.0.
RelativeFileMRU
Set to 0 to disable recent files on the same drive or network share as Notepad2.exe being saved with relative pathnames. The default is 1 (enabled).
PortableMyDocs
If set to 1, recent files and other path settings referring to the My Documents directory tree are stored relative to My Documents. This enhances USB stick portability between Windows XP and more recent versions of Windows, which are using different locations for My Documents. This setting has no effect if Notepad2.exe itself is located inside My Documents (or a subdirectory thereof). The default is 1 (enabled) if RelativeFileMRU is enabled, and 0 (disabled) otherwise.
DefaultExtension
Specify the default extension for saved files (omit the leading dot, just like txt or html).
As of version 5.0, the default extension is txt, and a value of (none) needs to specified if no default extension is preferred. To save a file without extension (regardless of the default extension setting), put the filename in double quotes.
DefaultDirectory
Specify the default directory for the open and save dialogs, used if no file is opened. Pathnames can be relative to the Notepad2 program directory.
FileDlgFilters
Specify filters for the open and save dialogs (Example: Text Files|*.txt;*.wtx;*.log;*.asc;*.doc;*.diz;*.nfo|All Files|*.*).
FileCheckInterval
The interval (in milliseconds) to check for external modification of the currently opened file. Defaults to 2000 ms.
AutoReloadTimeout
The timeout (in milliseconds) to wait before automatically reloading modified files. The default value of 2000 ms usually prevents read/write conflicts.
FileLoadWarningMB
The size limit, in megabytes, to display a warning message for large files. A value of 0 disables the warning.
OpacityLevel
Opacity level (in %) of the Notepad2 window in transparent mode.
NoFadeHidden
Set to 1 to disable fading of hidden objects in file lists (such as Favorites, etc.).
ToolbarLook
Determines the look of disabled toolbar buttons. 0 means system default (dark-grey and somewhat grainy on Windows Vista and Windows 7; not available on Windows 2000), 1 means colored and faded (the default from Notepad2 4.2.25 on Windows XP and above), and 2 means Windows XP-style light-grey (the default from Notepad2 4.2.25 on Windows 2000; looks better than the system default on Windows Vista and Windows 7).
SelectionHistory
This option can be used to control how text selection is restored after undo and redo operations. Below is a listing of supported values, along with the indication for which operations text selection will be restored, and whether the restored selection for undo operations is expanded to the full range of affected text:
0 : none; compatible with Notepad2 prior to version 5.0
1 : undo (expand to full range of affected text) & redo; default
2 : undo (no expansion) & redo
3 : undo only (expand to full range of affected text)
4 : undo only (no expansion)
5 : redo only
"Expand to full range of affected text" means that for editing operations always affecting full (and not only partial) lines of text, selection for undo operations is restored to span the full range of affected text. This can be demonstrated by partially selecting two consecutive lines of text, hitting Tab to indent the lines, and then hitting Ctrl+Z and Ctrl+Y to undo and redo the indentation.
SimpleIndentGuides
Set to 1 to prevent indentation guides from jumping across empty lines.
NoHTMLGuess
Set to 1 to disable simple HTML/XML detection for files without extensions.
NoCGIGuess
Set to 1 to disable simple language detection for cgi and fcgi files.
NoFileVariables
Set to 1 to disable file variable parsing. Encoding tag parsing can be disabled in the File, Encoding, Default dialog box.
StickyBOM
Specifies whether empty files (i.e. with zero-length text) should be saved with a byte order mark (UTF-16 BOM, UTF-16 BE BOM, or UTF-8 Signature) if applicable, or just as a zero-length file. Note that empty files are treated as if they have a byte order mark, in case the default encoding set in Notepad2 also has a byte order mark.
NoDirect2D
Set to 1 to disable Direct2D and DirectWrite, and use Windows GDI for drawing. On Windows Vista and above, Direct2D is the default, unless explicitly disabled with this directive. Note that Direct2D is not available on Windows 2000 and Windows XP.
filebrowser.exe
Specify the path of an external program that is launched when pressing the Browse toolbar button. Defaults to metapath.exe, which is my file browser plugin (found in the Project Archive). You can specify additional command line switches, and the file currently opened in Notepad2 will be appended as the last command line parameter.
To have the current file selected in Windows Explorer when pressing the browse toolbar button, set this entry to "explorer.exe /e,/select,%1".
Note: Due to special treatment of quotes by the Win32 ini-file APIs, pathnames with spaces need to be quadruple-quoted (""path to/file.exe""), but only double-quoted if there's additional command line arguments ("path to/file.exe" /arg).
DateTimeShort
DateTimeLong
Specify the short/long date and time formats. This is the format parameter passed to the strftime() function. Note that the locale will be set to English (because of the English Visual C++ Runtime Library used by Notepad2).
TimeStamp
Regular expression used to update timestamps.
WebTemplate1
WebTemplate2
Undocumented. Dangerous.
ShellAppUserModelID
ShellUseSystemMRU
Control system MRU, taskbar and jump list behaviour. See Replacing Windows Notepad for detailed explanations.

Where are the translated versions of Notepad2?

The expense of collecting, testing, packaging and hosting translated versions of Notepad2 was more than I felt happy with for my hobby project. Switching to a simple list of links was not much better: the many links to file sharing hosts appeared somewhat dubious, and they still had to be updated with each new release of the translated files.

Often I received e-mails with reported linguistic mistakes not being fixed by the authors, or several people competing for a translation to the same language.

That's why, for the time being, I have decided not to take care of translated versions of Notepad2, any longer. I may change my mind once I have more free time for my hobby project, or there may be someone else interested in operating a Notepad2 International website.

Am I allowed to ... ?

The answer to all the above question is: Yes! Notepad2 may be used freely for private, educational and commercial purpose. You are also allowed to modify or translate Notepad2 and redistribute your altered version, as long as the conditions outlined in the included License.txt file are granted.

Please do not charge any distribution fees for Notepad2.

I don't recommend bundling Notepad2 with other applications, as some users may prefer another text editor, and by providing a link to the Notepad2 website, you make sure people are always using the most recent version.

Why should I use the x64 build of Notepad2?

Will it run faster? Theoretically, yes. Usually, 32-bit machine code is processed natively by the CPU on 64-bit Windows, but there's still the slight overhead of the WOW64 emulator. This difference probably doesn't matter at all in daily use.

Will it open larger files? No, the underlying Scintilla source code editing component internally works with 32-bit integers, so there's the same size limits for the 32-bit and the 64-bit builds.

Better system integration! The WOW64 File System Redirector may cause some trouble. There's sophisticated rules how access to system files is redirected for WOW64 applications, so there may be a few special cases where knowledge of these rules is required to be able to edit system files using the 32-bit version of Notepad2 on a 64-bit machine.

So why not temporarily disabling the WOW64 File System Redirector and make the 32-bit version of Notepad2 feel at home on 64-bit systems? Turning off the File System Redirector permanently is discouraged by Microsoft. Disabling it temporarily whenever a file is opened may work well for files only available in one of the %windir%\System32 or %windir%\SysWOW64 directories. But as far as I've seen there's no clear solution for the situation where a file is available in both the %windir%\System32 and %windir%\SysWOW64 directories. It's necessary anyway to use the non-ambiguous %windir%\Sysnative virtual directory to access 64-bit system files from 32-bit applications.

So, here's the summary:

Using the 32-bit build of Notepad2 is no problem on 64-bit systems, if working with files outside the system directories.

Access to 64-bit system files with the 32-bit version of Notepad2 should go through the %windir%\Sysnative virtual directory (this also works for the 32-bit version of metapath). Note that the File System Redirector skips some directories, including %windir%\system32\drivers\etc, the location of the famous hosts file.

If working on 64-bit system files regularly, or the setup tool is used perform registry-based replacement of the Windows Notepad, the 64-bit build of Notepad2 is preferred (that is, even required for the latter case).

How to use the Notepad2 Setup Tool to install and update Notepad2?

The Notepad2 Setup Tool can be used to replace Windows Notepad with Notepad2, using a clean, unintrusive registry-based method (read about the technical details). The Windows Notepad can't be used any more, as long as Notepad2 is installed.

The Windows Notepad can be restored by uninstalling Notepad2 from the Control Panel. Uninstalling will also remove the Notepad2 settings stored in %APPDATA%\Notepad2.ini, therefore backup this file manually if you'd like to keep the settings. Installing a newer version of Notepad2 will not overwrite existing settings.

The setup tool accepts the /QUIET (or equivalent /SILENT) and /EXTRACT command line switches. Note that QUIET mode does not suppress the UAC prompt. The switches also work as part of the filename, i.e. the setup tool can be renamed to "Notepad2-Install-Silent.exe" to always launch in QUIET mode.

To have Windows 7 jump lists work properly, Notepad2 windows are assigned to a custom AppUserModelID by the setup tool, that's why multiple icons may appear if Notepad2.exe is directly pinned to the taskbar. To fix this, open a new Notepad2 window first, and then pin it to the taskbar from the Notepad2 taskbar button context menu.


© Florian Balmer 1996-2013
Page last modified: June 04, 2013