Package-level declarations

Types

Link copied to clipboard
data class HistoryConfig(val groupDelay: Long = DEFAULT_GROUP_DELAY, val minDepth: Int = 100)

Properties

Link copied to clipboard

Add a cursor on the line above each existing cursor head. Creates a new selection range at the vertically projected position, keeping all existing selections.

Link copied to clipboard

Add a cursor on the line below each existing cursor head.

Link copied to clipboard

Add a block comment around the selection.

Link copied to clipboard

Remove a block comment around the selection.

Link copied to clipboard

Key bindings for comment commands.

Link copied to clipboard

Copy the selected line(s) downward (duplicate below).

Link copied to clipboard

Copy the selected line(s) upward (duplicate above).

Link copied to clipboard

Move cursor one character backward (logical direction).

Link copied to clipboard

Move cursor one character backward by logical string index, using grapheme cluster breaks for boundary detection.

Link copied to clipboard

Move cursor one character forward (logical direction).

Link copied to clipboard

Move cursor one character forward by logical string index, using grapheme cluster breaks for boundary detection.

Link copied to clipboard

Move cursor one character to the left.

Link copied to clipboard

Move cursor one character to the right.

Link copied to clipboard

Move cursor to the end of the document.

Link copied to clipboard

Move cursor to the start of the document.

Link copied to clipboard

Move cursor one word group backward (logical direction).

Link copied to clipboard

Move cursor one word group forward (logical direction).

Link copied to clipboard

Move cursor to the start of the next word group (Windows convention). Unlike cursorGroupForward which stops at the end of the current group, this skips past trailing whitespace and stops at the beginning of the next word.

Link copied to clipboard

Move cursor one word group to the left.

Link copied to clipboard

Move cursor one word group to the right.

Link copied to clipboard

Move cursor to the line boundary in the backward direction.

Link copied to clipboard

Move cursor to the line boundary in the forward direction. In the absence of soft line wrapping, this is equivalent to cursorLineEnd.

Link copied to clipboard

Move cursor to the line boundary on the left side (visual direction). Same as cursorLineBoundaryBackward in left-to-right text.

Link copied to clipboard

Move cursor to the line boundary on the right side (visual direction). Same as cursorLineBoundaryForward in left-to-right text.

Link copied to clipboard

Move cursor one line down.

Link copied to clipboard

Move cursor to the end of the current line.

Link copied to clipboard

Move cursor to the start of the current line.

Link copied to clipboard

Move cursor one line up.

Link copied to clipboard

Move cursor to the matching bracket.

Link copied to clipboard

Move cursor one page down.

Link copied to clipboard

Move cursor one page up.

Link copied to clipboard

Move cursor one subword backward (camelCase-aware).

Link copied to clipboard

Move cursor one subword forward (camelCase-aware).

Link copied to clipboard

Move cursor to the nearest syntax boundary in the left direction. Tries bracket matching first; if no bracket match is found, walks the syntax tree to find the nearest enclosing node boundary.

Link copied to clipboard

Move cursor to the nearest syntax boundary in the right direction.

Link copied to clipboard

Extended keymap that adds line operations, indent commands, and more on top of standardKeymap.

Link copied to clipboard

Delete one character backward (Backspace).

Link copied to clipboard

Delete one character backward without indent-unit awareness.

Link copied to clipboard

Delete one character forward (Delete key).

Link copied to clipboard

Delete one word group backward.

Link copied to clipboard

Delete one word group forward.

Link copied to clipboard

Delete to the start of the next word group (Windows convention). Deletes through trailing whitespace to the beginning of the next word.

Link copied to clipboard

Delete the entire current line (including line break).

Link copied to clipboard

Delete to the line boundary in the backward direction. In the absence of soft line wrapping, this is equivalent to deleteToLineStart.

Link copied to clipboard

Delete to the line boundary in the forward direction. In the absence of soft line wrapping, this is equivalent to deleteToLineEnd.

Link copied to clipboard

Delete from cursor to the end of the line.

Link copied to clipboard

Delete from cursor to the start of the line.

Link copied to clipboard

Remove trailing whitespace from every line in the document.

Link copied to clipboard

Emacs-style key bindings.

Link copied to clipboard

The state field that stores undo/redo history. Can be used to check whether history is active in a given state (by checking state.field(historyField, false) != null) or to check undo/redo availability via undoDepth and redoDepth.

Link copied to clipboard

Remove one level of indentation from each line in the selection.

Link copied to clipboard

Add one level of indentation to each line in the selection.

Link copied to clipboard

Key bindings that use Tab/Shift-Tab for indentation.

Link copied to clipboard

Insert an empty line below the current line.

Link copied to clipboard

Insert a newline.

Link copied to clipboard

Insert a newline and indent using language-aware indentation when available, falling back to copying leading whitespace.

Link copied to clipboard

Insert a newline and copy the leading whitespace from the current line without any smart indentation logic.

Link copied to clipboard

Insert a tab character or indent unit.

Link copied to clipboard

This annotation can be used on transactions to prevent them from being combined with other transactions in the undo history. Given "before", it'll prevent grouping with previous events. With "after", it prevents grouping with the next event. "full" does both.

Link copied to clipboard

Add line comments to selected lines.

Link copied to clipboard

Remove line comments from selected lines.

Link copied to clipboard

Move the selected line(s) down by one line.

Link copied to clipboard

Move the selected line(s) up by one line.

Link copied to clipboard

Insert a newline and auto-indent. This is an alias for insertNewlineAndIndent, exported as a separate name to match the upstream CodeMirror API.

Link copied to clipboard

Redo the last undone change.

Link copied to clipboard

Redo a change or selection change.

Link copied to clipboard

Select the entire document.

Link copied to clipboard

Extend selection one character backward (logical direction).

Link copied to clipboard

Extend selection one character backward by logical string index, using grapheme cluster breaks.

Link copied to clipboard

Extend selection one character forward (logical direction).

Link copied to clipboard

Extend selection one character forward by logical string index, using grapheme cluster breaks.

Link copied to clipboard

Extend selection one character to the left.

Link copied to clipboard

Extend selection one character to the right.

Link copied to clipboard

Extend selection to the end of the document.

Link copied to clipboard

Extend selection to the start of the document.

Link copied to clipboard

Extend selection one word group backward (logical direction).

Link copied to clipboard

Extend selection one word group forward (logical direction).

Link copied to clipboard

Extend selection to the start of the next word group (Windows convention).

Link copied to clipboard

Extend selection one word group to the left.

Link copied to clipboard

Extend selection one word group to the right.

Link copied to clipboard

Expand selection to cover full lines.

Link copied to clipboard

Extend selection to the line boundary in the backward direction.

Link copied to clipboard

Extend selection to the line boundary in the forward direction.

Link copied to clipboard

Extend selection to the line boundary on the left side (visual).

Link copied to clipboard

Extend selection to the line boundary on the right side (visual).

Link copied to clipboard

Extend selection one line down.

Link copied to clipboard

Extend selection to the end of the current line.

Link copied to clipboard

Extend selection to the start of the current line.

Link copied to clipboard

Extend selection one line up.

Link copied to clipboard

Extend selection to the matching bracket.

Link copied to clipboard

Select the next occurrence of the current selection text (Ctrl-D style).

Link copied to clipboard

Extend selection one page down.

Link copied to clipboard

Extend selection one page up.

Link copied to clipboard

Select the enclosing syntax node (parent) of the current selection. Repeatedly invoking expands the selection to larger and larger nodes.

Link copied to clipboard

Extend selection one subword backward (camelCase-aware).

Link copied to clipboard

Extend selection one subword forward (camelCase-aware).

Link copied to clipboard

Extend selection to the nearest syntax boundary on the left.

Link copied to clipboard

Extend selection to the nearest syntax boundary on the right.

Link copied to clipboard

Collapse each non-empty selection range to a cursor at its anchor.

Link copied to clipboard

Insert a newline, but keep the cursor before it (splits the line without moving cursor down).

Link copied to clipboard

Essential key bindings for basic editing: arrow keys, deletion, selection, Enter, and select-all.

Link copied to clipboard

Toggle block comments around the selection.

Link copied to clipboard

Toggle line comments on selected lines.

Link copied to clipboard

Swap the characters before and after the cursor.

Link copied to clipboard

Undo the last change.

Link copied to clipboard

Undo a change or selection change. Unlike undo, this will also restore selection-only changes (cursor movements) that occurred between edits, stepping through selection history.

Functions

Link copied to clipboard

Convenience function to create an extension from the defaultKeymap.

Link copied to clipboard
fun history(config: HistoryConfig = HistoryConfig()): Extension
Link copied to clipboard
Link copied to clipboard

Convenience function to create an extension from the standardKeymap.

Link copied to clipboard