Skip to content

Customize Schemes

zufuliu edited this page Nov 1, 2022 · 44 revisions

Select Scheme

Click menu "Schemes" -> "Select Scheme..." or "Select Scheme" toolbar button.

Select Scheme

Favorite Schemes

Click menu "Schemes" -> "Favorite Schemes...".

Favorite Schemes

When "Auto-select by filename extension." is enabled, filename extension is matched in following order:

  1. Text File
  2. 2nd Text File
  3. Favorite schemes, in the order configured on this dialog
  4. Other general schemes, in alphabetical order (case insensitive)

Because Notepad2 supports many schemes, some of them you may never use, it's better to select your own favorite schemes (maximum 31). You can click checkbox before each scheme to add or remove it from Favorite Schemes.

Drag & drop is supported on scheme tree, you can drag schemes into Favorite Schemes, or reorder existing favorite schemes by drag & drop.

Drag & Drop for Favorite Schemes

Customize Schemes

Click menu "Schemes" -> "Customize Schemes..." or "Customize Schemes" toolbar button.

Customize Schemes

Drag & drop is supported on scheme tree, you can copy style settings to other styles by drag & drop.

Scheme Style Format

The "Style format" text on Customize Schemes dialog is copyable.

Style format:
	font:Name; size:[+|-]nn.mm; weight:nnn; bold; italic;
	underline; strike; overline; charset:dd; locale:Name;
	fore:#RRGGBB; back:#RRGGBB; alpha:aa; outline:aa; eolfilled;
Property Description
font[1] case insensitive font/typeface name, such as Source Code Pro Semibold or DejaVu Serif Condensed. $(Code) and $(Text) can be used to refer global default font set in Default Code Style and Default Text Style.
size[1] font size in point, such as 11.5 (on some systems, fractional font size need be typed manually). When prefixed by plus or minus sign, the value is a relative value to font size set in scheme's Default style. See below for other usages in global styles.
weight[1] font weight. see lfWeight at https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-logfonta for typical values (some of them don't apply to CJK fonts).
bold[1] bold font weight, equals to weight:700.
italic[1] italic font style.
underline[1] underline font style.
strike[1] strikethrough font style. Strikethrough is ignored when underline is set.
overline[1] overline font style. Overline is ignored when underline or strike is set.
charset[1] font character set, default to DEFAULT_CHARSET. ⚠WARNING: set charset to character set other than DEFAULT_CHARSET may cause strange behavior or data loss when document encoding is ANSI.
locale case insensitive locale name like zh-CN, zh-TW, ja-JP, ko-KR, etc. Used in Direct2D mode for language dependent glyphs, default to current user default locale. Noticeable usage is to view document contains CJK characters with appropriate glyphs in specific locale other than current locale.
fore[2] text foreground color. See below for other usages in global styles.
back[2] text background color. See below for other usages in global styles.
alpha[3] color transparency in [0, 256]. See below for other usages in global styles.
outline[3] indicator outline transparency in [0, 256]. See below for other usage in global styles.
eolfilled color background to right edge (near scroll bar) of editor window. Only a few styles support this property.
  • [1] values for these basic font properties are set automatically after choosing a font.
  • [2] color value is in hexadecimal format #RRGGBB, and is set automatically after pick a color.
  • [3] transparency value is between 0 (completely transparent) and 255 (opaque); 256 is for no transparency.
  • [4] property name is case sensitive, must in lower case. property value (font name, locale name, text case, etc.) is case insensitive.

Style Groups

  1. Font Styles: font, size, weight, bold, italic, underline, strike, overline, charset and locale. Font quality is set via Settings -> Advanced Settings -> Font Quality, default is ClearType.
  2. Indicator Styles: fore, alpha and outline. Indicator is draw over or under text, fore and alpha set the foreground color and transparency; outline set the transparency for outline (border).

Global Styles

Styles are applied in inherited order:

  1. One of Default Code Style and Default Text Style from Global Styles.
  2. The Default style for current scheme,
  3. Other individual styles in current scheme.

Following table shows global styles, individual styles are defined by it's lexer.

Style Description
Default Code Style Used as global style when Scheme -> Use Default Code Style is checked.
Default Text Style Used as global style when Scheme -> Use Default Code Style is not checked. The font is also used to print header and footer.
Margin and Line Number Styles (font styles, foreground and background colors) for line number margin.
Matching Brace Indicator styles for paired braces, brackets or angles.
Matching Brace Error Indicator styles for unpaired braces, brackets or angles.
Control Character Set font styles for control character (drawn with inverted text and background color, e.g. white on black or black on white based on theme.). fore can be used to change background color.
Indentation Guide Set foreground and background colors for indentation guide dash line.
Selected Text back and alpha set background color and transparency for main selection; fore and outline set background color and transparency for additional selection in multiple selections. eolfilled is supported on this style. size (in percentage to average character width, default is 100, i.e. one character width) set the extra fill width for line EOL is selected state when eolfilled is disabled.
Whitespace Set size (in pixel), foreground and background colors for space (drawn as dot) and tab (drawn as right arrow). The foreground color is also used to draw line warp symbol.
Current Line back and alpha set current line background color and transparency when View -> Highlight Line -> Background Color is checked; size, fore and outline set outline frame size, color and transparency when View -> Highlight Line -> Outline Frame is checked.
Caret fore set foreground color for main caret. back set foreground color for additional caret in multiple selections. Caret styles are set via View -> Caret Style. Caret blink time can be configured by CaretBlinkPeriod property (in milliseconds) in Settings section in Notepad2.ini; when the value is negative, system default blink time will be used; when it's zero, caret will not blinking; when the value is positive, caret will blinking with this value as period. 💡Tips: you can set caret width in system settings, see Microsoft document at https://support.microsoft.com/en-us/help/27928/windows-10-make-windows-easier-to-see
Long Line Marker fore set foreground when Show edge line is enabled on long line settings dialog. back set background color when Change background color is enabled.
Extra Line Spacing size in pixel, set extra ascent to size - size/2, extra descent to size/2.
Code Folding fore set line color for current block highlighting on fold margin, default is red. back set background color for fold margin, default is background color for text window.
Folding Marker fore set line color, back set fill color for plus/minus box.
Fold Ellipsis Styles for ellipsis draw after folded text.
Mark Occurrences Indicator styles.
IME Indicator Set foreground color for inline IME indicators.
Bookmark fore set bookmark symbol color on bookmark margin; back and alpha set background color and transparency for bookmarked lines when bookmark margin is hidden.
CallTip Styles for CallTip. CallTip (function, variables, etc.) is not yet implemented, currently used for notifications like the notification when a binary file is accidentally opened.

How to Add New Scheme

TBD.

See changes on adding GN build configuration file (issue #164, c8a291b).

Clone this wiki locally