Configuration

Full reference for every option accepted by createEditor(). Every field is optional — sensible defaults are applied for all options.

Updating at Runtime

Any option can be changed after creation. Config changes are applied incrementally — only the affected subsystems are rebuilt:

runtime-config.ts

// Toggle features after creation — no reload needed
editor.updateConfig({ wordWrap: true, showMinimap: false });

// Switch language (rebuilds highlighting + completions)
editor.updateConfig({ language: 'css' });

// Change font
editor.updateConfig({
  fontFamily: "'Fira Code', monospace",
  fontSize: 14,
  lineHeight: 24,
});

// Enter read-only mode
editor.updateConfig({ readOnly: true });

// Lock specific line ranges (0-based) while keeping the rest editable
editor.updateConfig({
  readOnlyRanges: [
    { start: 0, end: 4  },  // lines 1–5 locked
    { start: 20, end: 25 }, // lines 21–26 locked
  ],
});

// Unlock everything
editor.updateConfig({ readOnlyRanges: [] });

// Override token colours on top of the current theme
editor.updateConfig({
  tokenColors: { keyword: '#ff79c6', string: '#f1fa8c' },
});

// Restore all token colours to theme defaults
editor.updateConfig({ tokenColors: {} });

// Swap completions at runtime
editor.updateConfig({ completions: newCompletions });

Document

OptionTypeDefaultDescription
valuestring | string[]''

Initial document content. String or pre-split string[].

languageLanguage'typescript'

Syntax highlighting and autocomplete language. 17 built-ins: 'typescript' | 'javascript' | 'python' | 'java' | 'c' | 'cpp' | 'csharp' | 'go' | 'rust' | 'ruby' | 'php' | 'swift' | 'css' | 'sql' | 'json' | 'markdown' | 'text'.

Display

OptionTypeDefaultDescription
showGutterbooleantrue

Show/hide the line-number gutter.

showMinimapbooleantrue

Show/hide the canvas minimap panel.

showStatusBarbooleantrue

Show/hide the bottom status bar.

showIndentGuidesbooleantrue

Faint vertical lines at each indentation level.

highlightActiveLinebooleantrue

Background tint on the active line and gutter cell.

wordHighlightbooleantrue

Highlight all other occurrences of the word under the cursor.

renderWhitespace'none' | 'boundary' | 'all''none'

Spaces render as ·, tabs as →. 'boundary' = leading/trailing only.

Typography

OptionTypeDefaultDescription
fontFamilystring'JetBrains Mono', monospace

CSS font-family for all code text.

fontSizenumber13

Font size in pixels.

lineHeightnumber22

Row height in pixels. All scroll and minimap calculations derive from this.

Cursor

OptionTypeDefaultDescription
cursorStyle'line' | 'block' | 'underline''line'

Visual cursor shape.

cursorBlinkRatenumber1050

Blink period in ms. Set to 999999 to disable blinking.

Layout

OptionTypeDefaultDescription
gutterWidthnumber60

Gutter width in pixels.

minimapWidthnumber120

Minimap panel width in pixels.

wordWrapbooleanfalse

Soft-wrap long lines. Toggle at runtime with Alt+Z.

wrapColumnnumber80

Column at which soft-wrap breaks when wordWrap is true.

Editing

OptionTypeDefaultDescription
tabSizenumber2

Spaces per Tab press.

insertSpacesbooleantrue

Insert spaces on Tab; false inserts a literal tab character.

maxUndoHistorynumber300

Maximum undo snapshots retained.

undoBatchMsnumber700

Keystrokes within this window are grouped into one undo step. 0 = per-keystroke.

readOnlybooleanfalse

Block all edits. Navigation, selection, and copy still work.

readOnlyRangesReadOnlyRange[][]

Lock specific line ranges (0-based, inclusive). Edits, autocomplete, and snippets are blocked inside these ranges; hover, selection, and copy still work. Hovering a locked block reveals inline insert-line controls at its boundaries.

autoClosePairsRecord<string,string>{ '(':')', '[':']', ... }

Characters that auto-close. Pass {} to disable entirely.

lineCommentTokenstring''

Prefix for Ctrl+/ toggle comment. Auto-detects from language when empty.

wordSeparatorsstring''

Extra characters treated as word boundaries for double-click and Ctrl+←/→.

Features

OptionTypeDefaultDescription
bracketMatchingbooleantrue

Highlight matching ()[] {} pair at the cursor.

codeFoldingbooleantrue

Gutter fold button for collapsible {} blocks.

emmetbooleantrue

Emmet abbreviation expansion via Tab.

snippetExpansionbooleantrue

Tab-expand built-in and custom snippets.

autocompletebooleantrue

Show the autocomplete popup while typing.

autocompletePrefixLengthnumber2

Minimum characters typed before the popup appears.

multiCursorbooleantrue

Alt+Click and Ctrl+D multi-cursor.

findbooleantrue

Enable the find bar (Ctrl+F).

findReplacebooleantrue

Enable find-and-replace (Ctrl+H).

hoverbooleantrue

Show a documentation tooltip when the pointer rests on a known identifier.

wordSelectionbooleantrue

Double-click selects the word under the cursor.

goToLinebooleanfalse

Enable the Go to Line bar (Ctrl+G / Cmd+G). Opens a centred prompt; Enter jumps the cursor, Escape dismisses.

placeholderstring''

Ghost hint text shown in the editor when the document is completely empty. Hidden as soon as any content is present.

Autocomplete & Syntax

OptionTypeDefaultDescription
extraKeywordsstring[][]

Words highlighted as keywords and added to autocomplete.

extraTypesstring[][]

Words highlighted as types and added to autocomplete.

completionsCompletionItem[][]

Unified completions array — symbols, snippets, DSL items.

replaceBuiltinsbooleanfalse

When true, completions replaces the built-in language keywords/types entirely.

provideCompletions(ctx) => CompletionItem[] | nullundefined

Dynamic callback — called on every popup open.

provideHover(ctx) => HoverDoc | nullundefined

Dynamic hover callback for custom identifier docs.

provideTokens(line: string, language: string) => TokenSegment[]undefined

Fully override syntax tokenisation. Called for every visible line on every render. When set, the built-in tokeniser is never called.

maxCompletionsnumber14

Maximum items shown in the autocomplete popup.

Theme & Token Colors

OptionTypeDefaultDescription
themestring | ThemeDefinition'' (VR Dark)

Built-in theme ID or a full ThemeDefinition object.

tokenColorsTokenColors{}

Per-token colour overrides layered on top of the active theme.

Token Colors Quick Reference

Each field maps to a CSS variable and controls one token category. Set a value to override; set to '' (empty string) to restore the theme default for that token.

FieldCSS VariableHighlights
keyword--sl-keyword

Keywords (if, for, return, …)

string--sl-string

String literals

comment--sl-comment

Line and block comments

function--sl-function

Function / method names

number--sl-number

Numeric literals

class--sl-class

Class names

operator--sl-operator

Operators (+, ===, =>, …)

type--sl-type

Type annotations

decorator--sl-decorator

Decorators (@Component, …)

token-colors.ts

// Override specific tokens — all others stay from the active theme
editor.updateConfig({
  tokenColors: {
    keyword:   '#ff79c6',  // pink keywords
    string:    '#f1fa8c',  // yellow strings
    comment:   '#6272a4',  // muted blue comments
    function:  '#50fa7b',  // green functions
    number:    '#bd93f9',  // purple numbers
    class:     '#8be9fd',  // cyan class names
    operator:  '#f8f8f2',  // near-white operators
    type:      '#8be9fd',  // cyan types
    decorator: '#ffb86c',  // orange decorators
  },
});

// Restore everything to the current theme's defaults
editor.updateConfig({ tokenColors: {} });

// Remove just one override and keep the rest
editor.updateConfig({
  tokenColors: { ...currentOverrides, keyword: '' },
});

Callbacks

OptionTypeDefaultDescription
onChange(value: string) => voidundefined

Fired after every content change (keystroke, paste, undo, setValue).

onCursorChange(pos: CursorPosition) => voidundefined

Fired when the cursor moves.

onSelectionChange(sel: Selection | null) => voidundefined

Fired when the selection changes or clears.

onFocus() => voidundefined

Fired when the editor gains keyboard focus.

onBlur() => voidundefined

Fired when the editor loses keyboard focus.

Syncline Editor

© 2026 Syncline Editor. All rights reserved.