Skip to content

Type Editor


Type Editor / @type-editor/commands / select-all

select-all

Variables

VariableDescription

selectAll

Selects the entire document.

This command creates an AllSelection that encompasses the entire document content. It's typically bound to Ctrl-A/Cmd-A to provide standard "Select All" functionality.

Unlike some commands, this one always returns true because it can always be executed (there's always a document to select).

Param

The current editor state

Param

Optional dispatch function to execute the transaction

Example

typescript
// Bind to the standard Select All shortcut
const keymap = {
  "Mod-a": selectAll,
};

// Use programmatically
selectAll(view.state, view.dispatch);