Skip to content

Customize Schemes

Zufu Liu edited this page Apr 11, 2020 · 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;
	charset:dd; locale:Name; case:[Upper|Lower|Camel];
	fore:#ffffff; back:#bbbbbb; alpha:aa; outline:aa; eolfilled;
Property Description
font[1] case insensitive font face name like Source Code Pro Semibold or DejaVu Serif Condensed.
size[1] font size in point like 11.5. 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 meanings 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] strike through font style.
charset[1] font character set, default to DEFAULT_CHARSET. See lfCharSet at https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-logfonta
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.
case force text to displayed in specific case. e.g. SQL scheme can set case:Upper to Keyword style to display keywords in upper case.
fore[2] text foreground color. See below for other usage in global styles.
back[2] text background color. See below for other usage in global styles.
alpha[3] color transparency in [0, 256]. See below for other usage 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.

Style Groups

  • Font Styles: font, size, weight, bold, italic, underline, strike, charset, locale; Font quality is set via View -> Font Quality, default is ClearType.
  • Indicator Styles: fore, alpha, 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 global style when Scheme > Use Default Code Style is checked.
Default Text Style global style when Scheme > Use Default Code Style is not checked.
Margin and Line Number Style (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.).
Indentation Guide Set foreground and background colors for indentation guide dash line.
Selected Text --
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 Block set foreground color for current block highlighting on folding margin, default is red.
Current Line --
Caret fore set foreground color for main caret. back set foreground color for additional caret in multi-selection. Caret style is set via View -> Caret Style.
Long Line Marker Set foreground and background colors for long line marker.
Extra Line Spacing size in pixel, set extra ascent to size - size/2, extra descent to size/2.
Folding Marker fore set line color, back set fill color for plus/minus box.
Mark Occurrences Indicator styles.
Fold Ellipsis Style for ellipsis draw after folded text.
IME Indicator Set foreground color for inline IME indicators.
Bookmark fore set bookmark color on bookmark margin; back and alpha set bookmark background color and transparency when bookmark margin is hidden.
CallTip Styles for CallTip. CallTip (function, variables, etc.) is not yet implemented, currently used for notifications like 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