Type Editor / @type-editor/commands / select-all / selectAll
Variable: selectAll
ts
const selectAll: Command;Defined in: select-all.ts:28
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
Returns
Always returns true
Example
typescript
// Bind to the standard Select All shortcut
const keymap = {
"Mod-a": selectAll,
};
// Use programmatically
selectAll(view.state, view.dispatch);