Skip to content

Latest commit

 

History

History
1773 lines (1166 loc) · 101 KB

README.md

File metadata and controls

1773 lines (1166 loc) · 101 KB

Layouts

Dance uses VS Code keybindings to define command key-bindings. As such, its key-bindings must be configured differently depending on the keyboard layout. The following layouts will be* supported:

*: pending a future update; right now, only the default qwerty is supported.

Default commands (English, qwerty)

Quick reference
CategoryIdentifierTitleDefault keybindings
devdev.copyLastErrorMessageCopies the last encountered error message
dev.setSelectionBehaviorSet the selection behavior of the specified mode
editedit.alignAlign selectionsShift+7 (editorTextFocus && dance.mode == 'normal')
edit.case.swapSwap caseAlt+` (editorTextFocus && dance.mode == 'normal')
edit.case.toLowerTransform to lower case` (editorTextFocus && dance.mode == 'normal')
edit.case.toUpperTransform to upper caseShift+` (editorTextFocus && dance.mode == 'normal')
edit.copyIndentationCopy indentationShift+Alt+7 (editorTextFocus && dance.mode == 'normal')
edit.deindentDeindent selected linesShift+Alt+, (editorTextFocus && dance.mode == 'normal')
edit.deindent.withIncompleteDeindent selected lines (including incomplete indent)Shift+, (editorTextFocus && dance.mode == 'normal')
edit.deleteDeleteAlt+D (editorTextFocus && dance.mode == 'normal')
edit.delete-insertDelete and switch to InsertAlt+C (editorTextFocus && dance.mode == 'normal')
edit.newLine.above.insertInsert new line above and switch to insertShift+O (editorTextFocus && dance.mode == 'normal')
edit.newLine.below.insertInsert new line below and switch to insertO (editorTextFocus && dance.mode == 'normal')
edit.paste.afterPaste after
edit.paste.after.selectPaste after and selectP (editorTextFocus && dance.mode == 'normal')
edit.paste.beforePaste before
edit.paste.before.selectPaste before and selectShift+P (editorTextFocus && dance.mode == 'normal')
edit.pasteAll.afterPaste all after
edit.pasteAll.after.selectPaste all after and selectAlt+P (editorTextFocus && dance.mode == 'normal')
edit.pasteAll.beforePaste all before
edit.pasteAll.before.selectPaste all before and selectShift+Alt+P (editorTextFocus && dance.mode == 'normal')
edit.selectRegister-insertPick register and replaceCtrl+R (editorTextFocus && dance.mode == 'normal')Ctrl+R (editorTextFocus && dance.mode == 'insert')
edit.yank-deleteCopy and deleteD (editorTextFocus && dance.mode == 'normal')D (editorTextFocus && dance.mode == 'select')
edit.yank-delete-insertCopy, delete and switch to InsertC (editorTextFocus && dance.mode == 'normal')C (editorTextFocus && dance.mode == 'select')
edit.yank-replaceCopy and replaceShift+R (editorTextFocus && dance.mode == 'normal')
edit.indentIndent selected linesShift+. (editorTextFocus && dance.mode == 'normal')
edit.indent.withEmptyIndent selected lines (including empty lines)Shift+Alt+. (editorTextFocus && dance.mode == 'normal')
edit.insertInsert contents of registerShift+Alt+R (editorTextFocus && dance.mode == 'normal')
edit.joinJoin linesAlt+J (editorTextFocus && dance.mode == 'normal')
edit.join.selectJoin lines and select inserted separatorsShift+Alt+J (editorTextFocus && dance.mode == 'normal')
edit.newLine.aboveInsert new line above each selectionShift+Alt+O (editorTextFocus && dance.mode == 'normal')
edit.newLine.belowInsert new line below each selectionAlt+O (editorTextFocus && dance.mode == 'normal')
edit.replaceCharactersReplace charactersR (editorTextFocus && dance.mode == 'normal')
historyhistory.repeat.seekRepeat last seekAlt+. (editorTextFocus && dance.mode == 'normal')
history.repeat.selectionRepeat last selection change
history.recording.playReplay recordingQ (editorTextFocus && dance.mode == 'normal')
history.recording.startStart recordingShift+Q (editorTextFocus && dance.mode == 'normal' && !dance.isRecording)
history.recording.stopStop recordingEscape (editorTextFocus && dance.mode == 'normal' && dance.isRecording)Shift+Q (editorTextFocus && dance.mode == 'normal' && dance.isRecording)
history.redoRedoShift+U (editorTextFocus && dance.mode == 'normal')Shift+U (editorTextFocus && dance.mode == 'select')
history.redo.selectionsRedo a change of selectionsShift+Alt+U (editorTextFocus && dance.mode == 'normal')
history.repeatRepeat last change
history.repeat.editRepeat last edit without a command. (editorTextFocus && dance.mode == 'normal')NumPad_Decimal (editorTextFocus && dance.mode == 'normal')
history.undoUndoU (editorTextFocus && dance.mode == 'normal')U (editorTextFocus && dance.mode == 'select')
history.undo.selectionsUndo a change of selectionsAlt+U (editorTextFocus && dance.mode == 'normal')
keybindingskeybindings.setupSet up Dance keybindings
misccancelCancel Dance operationEscape (editorTextFocus && dance.mode == 'normal' && !dance.isRecording && !markersNavigationVisible)Escape (editorTextFocus && dance.mode == 'input')
changeInputChange current input
ifEmptyExecutes one of the specified commands depending on whether the current selections are empty
ignoreIgnore key
openMenuOpen menu
runRun code
selectRegisterSelect register for next commandShift+' (editorTextFocus && dance.mode == 'normal')
updateCountUpdate Dance count
updateRegisterUpdate the contents of a register
modesmodes.insert.afterInsert afterA (editorTextFocus && dance.mode == 'normal')
modes.insert.beforeInsert beforeI (editorTextFocus && dance.mode == 'normal')
modes.insert.lineEndInsert at line endShift+A (editorTextFocus && dance.mode == 'normal')
modes.insert.lineStartInsert at line startShift+I (editorTextFocus && dance.mode == 'normal')
modes.set.insertSet mode to Insert
modes.set.normalSet mode to NormalEscape (editorTextFocus && dance.mode == 'insert')Escape (editorTextFocus && dance.mode == 'select')
modes.set.selectSet mode to Select
modes.set.temporarily.insertTemporary Insert modeCtrl+V (editorTextFocus && dance.mode == 'normal')
modes.set.temporarily.normalTemporary Normal modeCtrl+V (editorTextFocus && dance.mode == 'insert')
modes.setSet Dance mode
modes.set.temporarilySet Dance mode temporarily
searchsearch.nextSelect next matchN (editorTextFocus && dance.mode == 'normal')
search.searchSearch/ (editorTextFocus && dance.mode == 'normal')NumPad_Divide (editorTextFocus && dance.mode == 'normal')
search.backwardSearch backwardAlt+/ (editorTextFocus && dance.mode == 'normal')
search.backward.extendSearch backward (extend)Shift+Alt+/ (editorTextFocus && dance.mode == 'normal')
search.extendSearch (extend)Shift+/ (editorTextFocus && dance.mode == 'normal')
search.next.addAdd next matchShift+N (editorTextFocus && dance.mode == 'normal')
search.previousSelect previous matchAlt+N (editorTextFocus && dance.mode == 'normal')
search.previous.addAdd previous matchShift+Alt+N (editorTextFocus && dance.mode == 'normal')
search.selection.smartSearch current selection (smart)Shift+8 (editorTextFocus && dance.mode == 'normal')NumPad_Multiply (editorTextFocus && dance.mode == 'normal')
search.selectionSearch current selectionShift+Alt+8 (editorTextFocus && dance.mode == 'normal')Alt+NumPad_Multiply (editorTextFocus && dance.mode == 'normal')
seekseek.enclosingSelect to next enclosing characterM (editorTextFocus && dance.mode == 'normal')
seek.leapLeap forward
seek.objectSelect object
seek.seekSelect to character (excluded)T (editorTextFocus && dance.mode == 'normal')
seek.askObjectSelect whole objectAlt+A (editorTextFocus && dance.mode == 'normal')Alt+A (editorTextFocus && dance.mode == 'insert')
seek.askObject.endSelect to whole object end] (editorTextFocus && dance.mode == 'normal')
seek.askObject.end.extendExtend to whole object endShift+] (editorTextFocus && dance.mode == 'normal')
seek.askObject.innerSelect inner objectAlt+I (editorTextFocus && dance.mode == 'normal')Alt+I (editorTextFocus && dance.mode == 'insert')
seek.askObject.inner.endSelect to inner object endAlt+] (editorTextFocus && dance.mode == 'normal')
seek.askObject.inner.end.extendExtend to inner object endShift+Alt+] (editorTextFocus && dance.mode == 'normal')
seek.askObject.inner.startSelect to inner object startAlt+[ (editorTextFocus && dance.mode == 'normal')
seek.askObject.inner.start.extendExtend to inner object startShift+Alt+[ (editorTextFocus && dance.mode == 'normal')
seek.askObject.startSelect to whole object start[ (editorTextFocus && dance.mode == 'normal')
seek.askObject.start.extendExtend to whole object startShift+[ (editorTextFocus && dance.mode == 'normal')
seek.backwardSelect to character (excluded, backward)Alt+T (editorTextFocus && dance.mode == 'normal')
seek.enclosing.backwardSelect to previous enclosing characterAlt+M (editorTextFocus && dance.mode == 'normal')
seek.enclosing.extendExtend to next enclosing characterShift+M (editorTextFocus && dance.mode == 'normal')
seek.enclosing.extend.backwardExtend to previous enclosing characterShift+Alt+M (editorTextFocus && dance.mode == 'normal')
seek.extendExtend to character (excluded)Shift+T (editorTextFocus && dance.mode == 'normal')T (editorTextFocus && dance.mode == 'select')
seek.extend.backwardExtend to character (excluded, backward)Shift+Alt+T (editorTextFocus && dance.mode == 'normal')Shift+T (editorTextFocus && dance.mode == 'select')
seek.includedSelect to character (included)F (editorTextFocus && dance.mode == 'normal')
seek.included.backwardSelect to character (included, backward)Alt+F (editorTextFocus && dance.mode == 'normal')
seek.included.extendExtend to character (included)Shift+F (editorTextFocus && dance.mode == 'normal')F (editorTextFocus && dance.mode == 'select')
seek.included.extend.backwardExtend to character (included, backward)Shift+Alt+F (editorTextFocus && dance.mode == 'normal')Shift+F (editorTextFocus && dance.mode == 'select')
seek.leap.backwardLeap backward
seek.syntax.child.experimentalSelect child syntax object
seek.syntax.next.experimentalSelect next syntax object
seek.syntax.parent.experimentalSelect parent syntax object
seek.syntax.previous.experimentalSelect previous syntax object
seek.word.backwardSelect to previous word startB (editorTextFocus && dance.mode == 'normal')
seek.word.extendExtend to next word startShift+W (editorTextFocus && dance.mode == 'normal')W (editorTextFocus && dance.mode == 'select')
seek.word.extend.backwardExtend to previous word startShift+B (editorTextFocus && dance.mode == 'normal')B (editorTextFocus && dance.mode == 'select')
seek.word.wsSelect to next non-whitespace word startAlt+W (editorTextFocus && dance.mode == 'normal')
seek.word.ws.backwardSelect to previous non-whitespace word startAlt+B (editorTextFocus && dance.mode == 'normal')
seek.word.ws.extendExtend to next non-whitespace word startShift+Alt+W (editorTextFocus && dance.mode == 'normal')Shift+W (editorTextFocus && dance.mode == 'select')
seek.word.ws.extend.backwardExtend to previous non-whitespace word startShift+Alt+B (editorTextFocus && dance.mode == 'normal')Shift+B (editorTextFocus && dance.mode == 'select')
seek.wordEndSelect to next word endE (editorTextFocus && dance.mode == 'normal')
seek.wordEnd.extendExtend to next word endShift+E (editorTextFocus && dance.mode == 'normal')E (editorTextFocus && dance.mode == 'select')
seek.wordEnd.wsSelect to next non-whitespace word endAlt+E (editorTextFocus && dance.mode == 'normal')
seek.wordEnd.ws.extendExtend to next non-whitespace word endShift+Alt+E (editorTextFocus && dance.mode == 'normal')Shift+E (editorTextFocus && dance.mode == 'select')
seek.syntax.experimentalSelect syntax object
seek.wordSelect to next word startW (editorTextFocus && dance.mode == 'normal')
selectselect.bufferSelect whole bufferShift+5 (editorTextFocus && dance.mode == 'normal')
select.firstVisibleLineSelect to first visible line
select.horizontallySelect horizontally
select.lastLineSelect to last line
select.lastVisibleLineSelect to last visible line
select.line.aboveSelect line above
select.line.above.extendExtend to line above
select.line.belowSelect line below
select.line.below.extendExtend to line below
select.lineEndSelect to line endAlt+L (editorTextFocus && dance.mode == 'normal')End (editorTextFocus && dance.mode == 'normal')
select.lineStartSelect to line startAlt+H (editorTextFocus && dance.mode == 'normal')Home (editorTextFocus && dance.mode == 'normal')
select.middleVisibleLineSelect to middle visible line
select.documentEnd.extendExtend to last character
select.documentEnd.jumpJump to last character
select.down.extendExtend downShift+J (editorTextFocus && dance.mode == 'normal')Shift+Down (editorTextFocus && dance.mode == 'normal')J (editorTextFocus && dance.mode == 'select')Down (editorTextFocus && dance.mode == 'select')
select.down.jumpJump downJ (editorTextFocus && dance.mode == 'normal')Down (editorTextFocus && dance.mode == 'normal')
select.firstLine.extendExtend to first line
select.firstLine.jumpJump to first line
select.firstVisibleLine.extendExtend to first visible line
select.firstVisibleLine.jumpJump to first visible line
select.lastLine.extendExtend to last line
select.lastLine.jumpJump to last line
select.lastVisibleLine.extendExtend to last visible line
select.lastVisibleLine.jumpJump to last visible line
select.left.extendExtend leftShift+H (editorTextFocus && dance.mode == 'normal')Shift+Left (editorTextFocus && dance.mode == 'normal')H (editorTextFocus && dance.mode == 'select')Left (editorTextFocus && dance.mode == 'select')
select.left.jumpJump leftH (editorTextFocus && dance.mode == 'normal')Left (editorTextFocus && dance.mode == 'normal')
select.lineEnd.extendExtend to line endShift+Alt+L (editorTextFocus && dance.mode == 'normal')Shift+End (editorTextFocus && dance.mode == 'normal')
select.lineStart.extendExtend to line startShift+Alt+H (editorTextFocus && dance.mode == 'normal')Shift+Home (editorTextFocus && dance.mode == 'normal')
select.lineStart.jumpJump to line start
select.lineStart.skipBlank.extendExtend to line start (skip blank)
select.lineStart.skipBlank.jumpJump to line start (skip blank)
select.middleVisibleLine.extendExtend to middle visible line
select.middleVisibleLine.jumpJump to middle visible line
select.right.extendExtend rightShift+L (editorTextFocus && dance.mode == 'normal')Shift+Right (editorTextFocus && dance.mode == 'normal')L (editorTextFocus && dance.mode == 'select')Right (editorTextFocus && dance.mode == 'select')
select.right.jumpJump rightL (editorTextFocus && dance.mode == 'normal')Right (editorTextFocus && dance.mode == 'normal')
select.to.extendExtend toShift+G (editorTextFocus && dance.mode == 'normal')G (editorTextFocus && dance.mode == 'select')
select.to.jumpGo toG (editorTextFocus && dance.mode == 'normal')
select.up.extendExtend upShift+K (editorTextFocus && dance.mode == 'normal')Shift+Up (editorTextFocus && dance.mode == 'normal')K (editorTextFocus && dance.mode == 'select')Up (editorTextFocus && dance.mode == 'select')
select.up.jumpJump upK (editorTextFocus && dance.mode == 'normal')Up (editorTextFocus && dance.mode == 'normal')
select.toSelect to
select.verticallySelect vertically
selectionsselections.changeDirectionChange direction of selectionsAlt+; (editorTextFocus && dance.mode == 'normal')
selections.changeOrderReverse selections
selections.copyCopy selections belowShift+C (editorTextFocus && dance.mode == 'normal')
selections.expandToLinesExpand to linesX (editorTextFocus && dance.mode == 'normal')
selections.filterFilter selectionsShift+4 (editorTextFocus && dance.mode == 'normal')
selections.mergeMerge contiguous selectionsShift+Alt+- (editorTextFocus && dance.mode == 'normal')
selections.openOpen selected file
selections.pipePipe selectionsShift+Alt+\ (editorTextFocus && dance.mode == 'normal')
selections.reduceReduce selections to their cursor; (editorTextFocus && dance.mode == 'normal')
selections.restoreRestore selectionsZ (editorTextFocus && dance.mode == 'normal')
selections.restore.withCurrentCombine register selections with current onesAlt+Z (editorTextFocus && dance.mode == 'normal')
selections.saveSave selectionsShift+Z (editorTextFocus && dance.mode == 'normal')
selections.saveTextCopy selections textY (editorTextFocus && dance.mode == 'normal')
selections.selectSelect within selections
selections.clear.mainClear main selectionsAlt+, (editorTextFocus && dance.mode == 'normal')
selections.clear.secondaryClear secondary selections, (editorTextFocus && dance.mode == 'normal')
selections.copy.aboveCopy selections aboveShift+Alt+C (editorTextFocus && dance.mode == 'normal')
selections.faceBackwardBackward selections
selections.faceForwardForward selectionsShift+Alt+; (editorTextFocus && dance.mode == 'normal')
selections.filter.regexpKeep matching selectionsAlt+K (editorTextFocus && dance.mode == 'normal')
selections.filter.regexp.inverseClear matching selectionsShift+Alt+K (editorTextFocus && dance.mode == 'normal')
selections.hideIndicesHide selection indices
selections.orderAscendingOrder selections ascending
selections.orderDescendingOrder selections descending
selections.pipe.appendPipe and appendShift+1 (editorTextFocus && dance.mode == 'normal')
selections.pipe.prependPipe and prependShift+Alt+1 (editorTextFocus && dance.mode == 'normal')
selections.pipe.replacePipe and replaceShift+\ (editorTextFocus && dance.mode == 'normal')
selections.reduce.edgesReduce selections to their endsShift+Alt+S (editorTextFocus && dance.mode == 'normal')
selections.select.orLeapLeap or selectS (editorTextFocus && dance.mode == 'normal')
selections.showIndicesShow selection indices
selections.splitLines.orLeap.backwardLeap or select backwardAlt+S (editorTextFocus && dance.mode == 'normal')
selections.sortSort selections
selections.splitSplit selectionsShift+S (editorTextFocus && dance.mode == 'normal')
selections.splitLinesSplit selections at line boundaries
selections.toggleIndicesToggle selection indicesEnter (editorTextFocus && dance.mode == 'normal')
selections.trimLinesTrim linesAlt+X (editorTextFocus && dance.mode == 'normal')
selections.trimWhitespaceTrim whitespaceShift+- (editorTextFocus && dance.mode == 'normal')
selections.rotateselections.rotate.bothRotate selections clockwiseShift+Alt+0 (editorTextFocus && dance.mode == 'normal')
selections.rotate.contentsRotate selections clockwise (contents only)
selections.rotate.selectionsRotate selections clockwise (selections only)Shift+0 (editorTextFocus && dance.mode == 'normal')
selections.rotate.both.reverseRotate selections counter-clockwiseShift+Alt+9 (editorTextFocus && dance.mode == 'normal')
selections.rotate.contents.reverseRotate selections counter-clockwise (contents only)
selections.rotate.selections.reverseRotate selections counter-clockwise (selections only)Shift+9 (editorTextFocus && dance.mode == 'normal')
viewview.lineReveals a position based on the main cursor

Developer utilities for Dance.

Set the selection behavior of the specified mode.

This command:

  • takes an argument mode of type string.
  • takes an argument value of type "caret" | "character".

Copies the last encountered error message.

This command:

  • does not require an active text editor.

Perform changes on the text content of the document.

See https://github.com/mawww/kakoune/blob/master/doc/pages/keys.asciidoc#changes.

Insert contents of register.

A where argument may be specified to state where the text should be inserted relative to each selection. If unspecified, each selection will be replaced by the text.

Specify "shift": "select" to select the inserted selection, "shift": "extend" to extend to the inserted text, and nothing to keep the current selections.

Specify all to paste all contents next to each selection.

Additional commands

Title Identifier Keybinding Commands
Pick register and replace selectRegister-insert c-r (kakoune: normal), c-r (kakoune: insert) [".selectRegister", { +register }], [".edit.insert", { ... }]
Paste before paste.before [".edit.insert", { handleNewLine: true, where: "start", ... }]
Paste after paste.after [".edit.insert", { handleNewLine: true, where: "end" , ... }]
Paste before and select paste.before.select s-p (kakoune: normal) [".edit.insert", { handleNewLine: true, where: "start", shift: "select", ... }]
Paste after and select paste.after.select p (kakoune: normal) [".edit.insert", { handleNewLine: true, where: "end" , shift: "select", ... }]
Paste all before pasteAll.before [".edit.insert", { handleNewLine: true, where: "start", all: true, ... }]
Paste all after pasteAll.after [".edit.insert", { handleNewLine: true, where: "end" , all: true, ... }]
Paste all before and select pasteAll.before.select s-a-p (kakoune: normal) [".edit.insert", { handleNewLine: true, where: "start", all: true, shift: "select", ... }]
Paste all after and select pasteAll.after.select a-p (kakoune: normal) [".edit.insert", { handleNewLine: true, where: "end" , all: true, shift: "select", ... }]
Delete delete a-d (kakoune: normal) [".edit.insert", { register: "_", ... }]
Delete and switch to Insert delete-insert a-c (kakoune: normal) [".modes.set", { mode: "insert", +mode }], [".edit.insert", { register: "_", ... }]
Copy and delete yank-delete d (kakoune: normal), d (helix: select) [".selections.saveText", { +register }], [".edit.insert", { register: "_", ... }]
Copy, delete and switch to Insert yank-delete-insert c (kakoune: normal), c (helix: select) [".selections.saveText", { +register }], [".modes.set", { mode: "insert", +mode }], [".edit.insert", { register: "_", ... }]
Copy and replace yank-replace s-r (kakoune: normal) [".selections.saveText", { register: "tmp" }], [".edit.insert"], [".updateRegister", { copyFrom: "tmp", ... }]

This command:

  • accepts a register (by default, it uses dquote).
  • may be repeated with a given number of repetitions.
  • takes an argument adjust of type boolean.
  • takes an argument all of type boolean.
  • takes an argument handleNewLine of type boolean.
  • takes an argument shift of type Shift.
  • takes an argument text of type string.
  • takes an argument where of type "active" | "anchor" | "start" | "end" | undefined.

Default keybinding: s-a-r (kakoune: normal)

Join lines.

This command:

  • takes an argument separator of type string.

Default keybinding: a-j (kakoune: normal)

Join lines and select inserted separators.

This command:

  • takes an argument separator of type string.

Default keybinding: s-a-j (kakoune: normal)

Indent selected lines.

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: > (kakoune: normal)

Indent selected lines (including empty lines).

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: a-> (kakoune: normal)

Deindent selected lines.

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: a-< (kakoune: normal)

Deindent selected lines (including incomplete indent).

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: < (kakoune: normal)

Transform to lower case.

Default keybinding: ` (kakoune: normal)

Transform to upper case.

Default keybinding: s-` (kakoune: normal)

Swap case.

Default keybinding: a-` (kakoune: normal)

Replace characters.

This command:

  • may be repeated with a given number of repetitions.
  • takes an input input of type string.

Default keybinding: r (kakoune: normal)

Align selections.

Align selections, aligning the cursor of each selection by inserting spaces before the first character of each selection.

This command:

  • takes an argument fill of type string.

Default keybinding: & (kakoune: normal)

Copy indentation.

Copy the indentation of the main selection (or the count one if a count is given) to all other ones.

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: a-& (kakoune: normal)

Insert new line above each selection.

Specify "shift": "select" to select the inserted selections, and nothing to keep the current selections.

Additional keybindings

Title Identifier Keybinding Commands
Insert new line above and switch to insert newLine.above.insert s-o (kakoune: normal) [".edit.newLine.above", { shift: "select" }], [".modes.insert.before", { ... }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument shift of type Shift.

Default keybinding: s-a-o (kakoune: normal)

Insert new line below each selection.

Specify "shift": "select" to select the inserted selections, and nothing to keep the current selections.

Additional keybindings

Title Identifier Keybinding Commands
Insert new line below and switch to insert newLine.below.insert o (kakoune: normal) [".edit.newLine.below", { shift: "select" }], [".modes.insert.before", { ... }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument shift of type Shift.

Default keybinding: a-o (kakoune: normal)

Interact with history.

Undo.

This command:

  • does not require an active text editor.

Default keybinding: u (kakoune: normal) u (helix: select)

Redo.

This command:

  • does not require an active text editor.

Default keybinding: s-u (kakoune: normal) s-u (helix: select)

Undo a change of selections.

This command:

  • does not require an active text editor.

Default keybinding: a-u (kakoune: normal)

Redo a change of selections.

This command:

  • does not require an active text editor.

Default keybinding: s-a-u (kakoune: normal)

Repeat last change.

Title Identifier Keybinding Commands
Repeat last selection change repeat.selection [".history.repeat", { filter: "dance\\.(seek|select|selections)", +count }]
Repeat last seek repeat.seek a-. (kakoune: normal) [".history.repeat", { filter: "dance\\.seek", +count }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument filter of type string | RegExp.

Repeat last edit without a command.

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: . (kakoune: normal) NumPad_Decimal (kakoune: normal)

Replay recording.

This command:

  • accepts a register (by default, it uses arobase).
  • does not require an active text editor.
  • may be repeated with a given number of repetitions.

Default keybinding: q (kakoune: normal)

Start recording.

This command:

  • accepts a register (by default, it uses arobase).

Default keybinding: s-q (kakoune: normal, !recording)

Stop recording.

This command:

  • accepts a register (by default, it uses arobase).

Default keybinding: escape (kakoune: normal, recording) s-q (kakoune: normal, recording)

Utilities for setting up keybindings.

Set up Dance keybindings.

This command:

  • accepts a register (by default, it uses dquote).

Miscellaneous commands that don't deserve their own category.

By default, Dance also exports the following keybindings for existing commands:

Keybinding Command
s-; (core: normal) ["workbench.action.showCommands", { ... }]

Cancel Dance operation.

This command:

  • does not require an active text editor.

Default keybinding: escape (core: normal, !recording, "!markersNavigationVisible") escape (core: input)

Ignore key.

This command:

  • does not require an active text editor.

Run code.

There are two ways to invoke this command. The first one is to provide an code string argument. This code must be a valid JavaScript string, and will be executed with full access to the Dance API. For instance,

{
  "command": "dance.run",
  "args": {
    "code": "Selections.set(Selections.filter(text => text.includes('foo')))",
  },
},

If no argument is provided, a prompt will be shown asking for an input. Furthermore, an array of strings can be passed to make longer functions easier to read:

{
  "command": "dance.run",
  "args": {
    "code": [
      "for (const selection of Selections.current) {",
      "  console.log(text(selection));",
      "}",
    ],
  },
},

The second way to use this command is with the commands argument. This argument must be an array of "command-like" values. The simplest "command-like" value is a string corresponding to the command itself:

{
  "command": "dance.run",
  "args": {
    "commands": [
      "dance.modes.set.normal",
    ],
  },
},

But arguments can also be provided by passing an array:

{
  "command": "dance.run",
  "args": {
    "commands": [
      ["dance.modes.set", { "mode": "normal" }],
    ],
  },
},

Or by passing an object, like regular VS Code key bindings:

{
  "command": "dance.run",
  "args": {
    "commands": [
      {
        "command": "dance.modes.set",
        "args": { "mode": "normal" },
      },
    ],
  },
},

These values can be mixed:

{
  "command": "dance.run",
  "args": {
    "commands": [
      ["dance.selections.saveText", { "register": "^" }],
      {
        "command": "dance.modes.set",
        "args": { "mode": "normal" },
      },
      "hideSuggestWidget",
    ],
  },
},

If both code and commands are given, Dance will use code if arbitrary code execution is enabled, or commands otherwise.

This command:

  • accepts a register (by default, it uses null).
  • accepts an argument of type { code?: string | readonly string[] }.
  • may be repeated with a given number of repetitions.
  • may be repeated with a given number of repetitions.
  • takes an argument commands of type command.Any[].
  • takes an input code of type string | readonly string[].

Select register for next command.

When selecting a register, the next key press is used to determine what register is selected. If this key is a space character, then a new key press is awaited again and the returned register will be specific to the current document.

This command:

  • takes an input register of type string | Register.

Default keybinding: " (kakoune: normal)

Update the contents of a register.

This command:

  • accepts a register (by default, it uses dquote).
  • takes an input input of type string.

Update Dance count.

Update the current counter used to repeat the next command.

Additional keybindings

Title Keybinding Command
Add the digit 0 to the counter 0 (core: normal), NumPad0 (core: normal) [".updateCount", { addDigits: 0 }]
Add the digit 1 to the counter 1 (core: normal), NumPad1 (core: normal) [".updateCount", { addDigits: 1 }]
Add the digit 2 to the counter 2 (core: normal), NumPad2 (core: normal) [".updateCount", { addDigits: 2 }]
Add the digit 3 to the counter 3 (core: normal), NumPad3 (core: normal) [".updateCount", { addDigits: 3 }]
Add the digit 4 to the counter 4 (core: normal), NumPad4 (core: normal) [".updateCount", { addDigits: 4 }]
Add the digit 5 to the counter 5 (core: normal), NumPad5 (core: normal) [".updateCount", { addDigits: 5 }]
Add the digit 6 to the counter 6 (core: normal), NumPad6 (core: normal) [".updateCount", { addDigits: 6 }]
Add the digit 7 to the counter 7 (core: normal), NumPad7 (core: normal) [".updateCount", { addDigits: 7 }]
Add the digit 8 to the counter 8 (core: normal), NumPad8 (core: normal) [".updateCount", { addDigits: 8 }]
Add the digit 9 to the counter 9 (core: normal), NumPad9 (core: normal) [".updateCount", { addDigits: 9 }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument addDigits of type number.
  • takes an input count of type number.

Open menu.

If no menu is specified, a prompt will ask for the name of the menu to open.

Alternatively, a menu can be inlined in the arguments.

Pass a prefix argument to insert the prefix string followed by the typed key if it does not match any menu entry. This can be used to implement chords like jj.

This command:

  • does not require an active text editor.
  • takes an argument delay of type number.
  • takes an argument locked of type boolean.
  • takes an argument pass of type any[].
  • takes an argument prefix of type string.
  • takes an argument title of type string.
  • takes an input menu of type string | Menu.

Change current input.

When showing some menus, Dance can navigate their history:

Keybinding Command
up (core: prompt) [".changeInput", { action: "previous" }]
down (core: prompt) [".changeInput", { action: "next" }]

This command:

  • does not require an active text editor.

Executes one of the specified commands depending on whether the current selections are empty.

This command:

  • accepts an argument of type {}.
  • takes an argument otherwise of type command.Any[].
  • takes an argument then of type command.Any[].

Set modes.

Set Dance mode.

Variants

Title Identifier Keybinding Command
Set mode to Normal set.normal escape (kakoune: insert), escape (helix: select) [".modes.set", { mode: "normal" }], ["hideSuggestWidget"]
Set mode to Insert set.insert [".modes.set", { mode: "insert" }]
Set mode to Select set.select [".modes.set", { mode: "select" }]

Other variants are provided to switch to insert mode:

Title Identifier Keybinding Commands
Insert before insert.before i (kakoune: normal) [".selections.faceBackward", { record: false }], [".modes.set", { mode: "insert", +mode }], [".selections.reduce", { where: "start", record: false, empty: true, ... }]
Insert after insert.after a (kakoune: normal) [".selections.faceForward" , { record: false }], [".modes.set", { mode: "insert", +mode }], [".selections.reduce", { where: "end" , record: false, empty: true, ... }]
Insert at line start insert.lineStart s-i (kakoune: normal) [".select.lineStart", { shift: "jump", skipBlank: true }], [".modes.set", { mode: "insert", +mode }], [".selections.reduce", { where: "start", record: false, empty: true, ... }]
Insert at line end insert.lineEnd s-a (kakoune: normal) [".select.lineEnd" , { shift: "jump" }], [".modes.set", { mode: "insert", +mode }], [".selections.reduce", { where: "end" , record: false, empty: true, ... }]

This command:

  • takes an input mode of type string.

Set Dance mode temporarily.

Variants

Title Identifier Keybindings Commands
Temporary Normal mode set.temporarily.normal c-v (kakoune: insert) [".modes.set.temporarily", { mode: "normal" }]
Temporary Insert mode set.temporarily.insert c-v (kakoune: normal) [".modes.set.temporarily", { mode: "insert" }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an input mode of type string.

Search for patterns and replace or add selections.

Search.

Title Identifier Keybinding Command
Search (extend) extend ? (kakoune: normal) [".search", { shift: "extend", ... }]
Search backward backward a-/ (kakoune: normal) [".search", { direction: -1 , ... }]
Search backward (extend) backward.extend a-? (kakoune: normal) [".search", { direction: -1, shift: "extend", ... }]

This command:

  • accepts a register (by default, it uses slash).
  • accepts an argument of type { re?: string | (RegExp & { originalSource?: string }) }.
  • may be repeated with a given number of repetitions.
  • takes an argument add of type boolean.
  • takes an argument interactive of type boolean.

Default keybinding: / (kakoune: normal) NumPad_Divide (kakoune: normal)

Search current selection.

Title Identifier Keybinding Command
Search current selection (smart) selection.smart * (kakoune: normal), NumPad_Multiply (kakoune: normal) [".search.selection", { smart: true, +register }]

This command:

  • accepts a register (by default, it uses slash).
  • takes an argument smart of type boolean.

Default keybinding: a-* (kakoune: normal) a-NumPad_Multiply (kakoune: normal)

Select next match.

Title Identifier Keybinding Command
Add next match next.add s-n (kakoune: normal) [".search.next", { add: true, ... }]
Select previous match previous a-n (kakoune: normal) [".search.next", { direction: -1 , ... }]
Add previous match previous.add s-a-n (kakoune: normal) [".search.next", { direction: -1, add: true, ... }]

This command:

  • accepts a register (by default, it uses slash).
  • may be repeated with a given number of repetitions.
  • takes an argument add of type boolean.

Default keybinding: n (kakoune: normal)

Update selections based on the text surrounding them.

Select to character (excluded).

Variants

Title Identifier Keybinding Command
Extend to character (excluded) extend s-t (kakoune: normal), t (helix: select) [".seek", { shift: "extend" , ... }]
Select to character (excluded, backward) backward a-t (kakoune: normal) [".seek", { direction: -1, ... }]
Extend to character (excluded, backward) extend.backward s-a-t (kakoune: normal), s-t (helix: select) [".seek", { shift: "extend", direction: -1, ... }]
Select to character (included) included f (kakoune: normal) [".seek", { include: true , ... }]
Extend to character (included) included.extend s-f (kakoune: normal), f (helix: select) [".seek", { include: true, shift: "extend" , ... }]
Select to character (included, backward) included.backward a-f (kakoune: normal) [".seek", { include: true, direction: -1, ... }]
Extend to character (included, backward) included.extend.backward s-a-f (kakoune: normal), s-f (helix: select) [".seek", { include: true, shift: "extend", direction: -1, ... }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument include of type boolean.
  • takes an input input of type string.

Default keybinding: t (kakoune: normal)

Select to next enclosing character.

Variants

Title Identifier Keybinding Command
Extend to next enclosing character enclosing.extend s-m (kakoune: normal) [".seek.enclosing", { shift: "extend" , ... }]
Select to previous enclosing character enclosing.backward a-m (kakoune: normal) [".seek.enclosing", { direction: -1, ... }]
Extend to previous enclosing character enclosing.extend.backward s-a-m (kakoune: normal) [".seek.enclosing", { shift: "extend", direction: -1, ... }]

This command:

  • takes an argument open of type boolean.
  • takes an argument pairs of type readonly string[].

Default keybinding: m (kakoune: normal)

Select to next word start.

Select the word and following whitespaces on the right of the end of each selection.

Variants

Title Identifier Keybinding Command
Extend to next word start word.extend s-w (kakoune: normal), w (helix: select) [".seek.word", { shift: "extend" , ... }]
Select to previous word start word.backward b (kakoune: normal) [".seek.word", { direction: -1, ... }]
Extend to previous word start word.extend.backward s-b (kakoune: normal), b (helix: select) [".seek.word", { shift: "extend", direction: -1, ... }]
Select to next non-whitespace word start word.ws a-w (kakoune: normal) [".seek.word", { ws: true , ... }]
Extend to next non-whitespace word start word.ws.extend s-a-w (kakoune: normal), s-w (helix: select) [".seek.word", { ws: true, shift: "extend" , ... }]
Select to previous non-whitespace word start word.ws.backward a-b (kakoune: normal) [".seek.word", { ws: true, direction: -1, ... }]
Extend to previous non-whitespace word start word.ws.extend.backward s-a-b (kakoune: normal), s-b (helix: select) [".seek.word", { ws: true, shift: "extend", direction: -1, ... }]
Select to next word end wordEnd e (kakoune: normal) [".seek.word", { stopAtEnd: true , ... }]
Extend to next word end wordEnd.extend s-e (kakoune: normal), e (helix: select) [".seek.word", { stopAtEnd: true , shift: "extend" , ... }]
Select to next non-whitespace word end wordEnd.ws a-e (kakoune: normal) [".seek.word", { stopAtEnd: true , ws: true , ... }]
Extend to next non-whitespace word end wordEnd.ws.extend s-a-e (kakoune: normal), s-e (helix: select) [".seek.word", { stopAtEnd: true , ws: true, shift: "extend" , ... }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument stopAtEnd of type boolean.
  • takes an argument ws of type boolean.

Default keybinding: w (kakoune: normal)

Select object.

Object patterns

  • Pairs: <regexp>(?#inner)<regexp>.

  • Character sets: [<characters>]+.

    • Can be preceded by (?<before>[<characters>]+) and followed by (?<after>[<character>]+) for whole objects.
  • Matches that may only span a single line: (?#singleline)<regexp>.

  • Predefined: (?#predefined=<argument | paragraph | sentence>).

Variants

Title Identifier Keybinding Command
Select whole object askObject a-a (kakoune: normal), a-a (kakoune: insert) [".openMenu", { menu: "object", title: "Select whole object..." }]
Select inner object askObject.inner a-i (kakoune: normal), a-i (kakoune: insert) [".openMenu", { menu: "object", pass: [{ inner: true }], title: "Select inner object..." }]
Select to whole object start askObject.start [ (kakoune: normal) [".openMenu", { menu: "object", pass: [{ where: "start" }] }]
Extend to whole object start askObject.start.extend { (kakoune: normal) [".openMenu", { menu: "object", pass: [{ where: "start", shift: "extend" }] }]
Select to inner object start askObject.inner.start a-[ (kakoune: normal) [".openMenu", { menu: "object", pass: [{ inner: true, where: "start" }] }]
Extend to inner object start askObject.inner.start.extend a-{ (kakoune: normal) [".openMenu", { menu: "object", pass: [{ inner: true, where: "start", shift: "extend" }] }]
Select to whole object end askObject.end ] (kakoune: normal) [".openMenu", { menu: "object", pass: [{ where: "end" }] }]
Extend to whole object end askObject.end.extend } (kakoune: normal) [".openMenu", { menu: "object", pass: [{ where: "end" , shift: "extend" }] }]
Select to inner object end askObject.inner.end a-] (kakoune: normal) [".openMenu", { menu: "object", pass: [{ inner: true, where: "end" }] }]
Extend to inner object end askObject.inner.end.extend a-} (kakoune: normal) [".openMenu", { menu: "object", pass: [{ inner: true, where: "end" , shift: "extend" }] }]

This command:

  • takes an argument inner of type boolean.
  • takes an argument where of type "start" | "end".
  • takes an input input of type string.

Select syntax object.

Variants

Title Identifier Command
Select next syntax object syntax.next.experimental [".seek.syntax.experimental", { where: "next" }]
Select previous syntax object syntax.previous.experimental [".seek.syntax.experimental", { where: "previous" }]
Select parent syntax object syntax.parent.experimental [".seek.syntax.experimental", { where: "parent" }]
Select child syntax object syntax.child.experimental [".seek.syntax.experimental", { where: "child" }]

This command:

  • takes an argument where of type "next" | "previous" | "parent" | "child".

Leap forward.

Inspired by leap.nvim.

Variants

Title Identifier Command
Leap backward leap.backward [".seek.leap", { direction: -1, ... }]

This command:

  • takes an argument labels of type string.

Update selections based on their position in the document.

Select whole buffer.

Default keybinding: % (kakoune: normal)

Select vertically.

Variants

Title Identifier Keybinding Command
Jump down down.jump j (kakoune: normal) , down (kakoune: normal) [".select.vertically", { direction: 1, shift: "jump" , ... }]
Extend down down.extend s-j (kakoune: normal), s-down (kakoune: normal), j (helix: select), down (helix: select) [".select.vertically", { direction: 1, shift: "extend", ... }]
Jump up up.jump k (kakoune: normal) , up (kakoune: normal) [".select.vertically", { direction: -1, shift: "jump" , ... }]
Extend up up.extend s-k (kakoune: normal), s-up (kakoune: normal) , k (helix: select), up (helix: select) [".select.vertically", { direction: -1, shift: "extend", ... }]

The following keybindings are also defined:

Keybinding Command
c-f (kakoune: normal), c-f (kakoune: insert) [".select.vertically", { direction: 1, by: "page" , shift: "jump" }]
c-d (kakoune: normal), c-d (kakoune: insert) [".select.vertically", { direction: 1, by: "halfPage", shift: "jump" }]
c-b (kakoune: normal), c-b (kakoune: insert) [".select.vertically", { direction: -1, by: "page" , shift: "jump" }]
c-u (kakoune: normal), c-u (kakoune: insert) [".select.vertically", { direction: -1, by: "halfPage", shift: "jump" }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument avoidEol of type boolean.
  • takes an argument by of type "page" | "halfPage".

Select horizontally.

Variants

Title Identifier Keybinding Command
Jump right right.jump l (kakoune: normal) , right (kakoune: normal) [".select.horizontally", { direction: 1, shift: "jump" , ... }]
Extend right right.extend s-l (kakoune: normal), s-right (kakoune: normal), l (helix: select), right (helix: select) [".select.horizontally", { direction: 1, shift: "extend", ... }]
Jump left left.jump h (kakoune: normal) , left (kakoune: normal) [".select.horizontally", { direction: -1, shift: "jump" , ... }]
Extend left left.extend s-h (kakoune: normal), s-left (kakoune: normal), h (helix: select), left (helix: select) [".select.horizontally", { direction: -1, shift: "extend", ... }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument avoidEol of type boolean.

Select to.

If a count is specified, this command will shift to the start of the given line. If no count is specified, this command will shift open the goto menu.

Variants

Title Identifier Keybinding Command
Go to to.jump g (kakoune: normal) [".select.to", { shift: "jump" , ... }]
Extend to to.extend s-g (kakoune: normal), g (helix: select) [".select.to", { shift: "extend", ... }]

This command:

  • accepts an argument of type object.
  • may be repeated with a given number of repetitions.

Select line below.

This command:

  • may be repeated with a given number of repetitions.

Extend to line below.

This command:

  • may be repeated with a given number of repetitions.

Select line above.

This command:

  • may be repeated with a given number of repetitions.

Extend to line above.

This command:

  • may be repeated with a given number of repetitions.

Select to line start.

Variants

Title Identifier Keybinding Command
Jump to line start lineStart.jump [".select.lineStart", { shift: "jump" , ... }]
Extend to line start lineStart.extend s-a-h (kakoune: normal), s-home (kakoune: normal) [".select.lineStart", { shift: "extend", ... }]
Jump to line start (skip blank) lineStart.skipBlank.jump [".select.lineStart", { skipBlank: true, shift: "jump" , ... }]
Extend to line start (skip blank) lineStart.skipBlank.extend [".select.lineStart", { skipBlank: true, shift: "extend", ... }]
Jump to first line firstLine.jump [".select.lineStart", { count: 0, shift: "jump" , ... }]
Extend to first line firstLine.extend [".select.lineStart", { count: 0, shift: "extend", ... }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument skipBlank of type boolean.

Default keybinding: a-h (kakoune: normal) home (kakoune: normal)

Select to line end.

Variants

Title Identifier Keybinding Command
Extend to line end lineEnd.extend s-a-l (kakoune: normal), s-end (kakoune: normal) [".select.lineEnd", { shift: "extend", ... }]
Jump to last character documentEnd.jump [".select.lineEnd", { count: MAX_INT, shift: "jump" , ... }]
Extend to last character documentEnd.extend [".select.lineEnd", { count: MAX_INT, shift: "extend", ... }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument lineBreak of type boolean.

Default keybinding: a-l (kakoune: normal) end (kakoune: normal)

Select to last line.

Variants

Title Identifier Command
Jump to last line lastLine.jump [".select.lastLine", { shift: "jump" }]
Extend to last line lastLine.extend [".select.lastLine", { shift: "extend" }]

Select to first visible line.

Variants

Title Identifier Command
Jump to first visible line firstVisibleLine.jump [".select.firstVisibleLine", { shift: "jump" }]
Extend to first visible line firstVisibleLine.extend [".select.firstVisibleLine", { shift: "extend" }]

Select to middle visible line.

Variants

Title Identifier Command
Jump to middle visible line middleVisibleLine.jump [".select.middleVisibleLine", { shift: "jump" }]
Extend to middle visible line middleVisibleLine.extend [".select.middleVisibleLine", { shift: "extend" }]

Select to last visible line.

Variants

Title Identifier Command
Jump to last visible line lastVisibleLine.jump [".select.lastVisibleLine", { shift: "jump" }]
Extend to last visible line lastVisibleLine.extend [".select.lastVisibleLine", { shift: "extend" }]

Interacting with selections.

Copy selections text.

This command:

  • accepts a register (by default, it uses dquote).

Default keybinding: y (kakoune: normal)

Save selections.

This command:

  • accepts a register (by default, it uses caret).
  • takes an argument style of type object.
  • takes an argument untilDelay of type number.
  • takes an argument until of type AutoDisposable.Event[].

Default keybinding: s-z (kakoune: normal)

Restore selections.

This command:

  • accepts a register (by default, it uses caret).

Default keybinding: z (kakoune: normal)

Combine register selections with current ones.

The following keybinding is also available:

Keybinding Command
s-a-z (kakoune: normal) [".selections.restore.withCurrent", { reverse: true, ... }]

See https://github.com/mawww/kakoune/blob/master/doc/pages/keys.asciidoc#marks

This command:

  • accepts a register (by default, it uses caret).
  • takes an argument action of type "a" | "u" | "i" | "<" | ">" | "+" | "-".
  • takes an argument reverse of type boolean.

Default keybinding: a-z (kakoune: normal)

Pipe selections.

Run the specified command or code with the contents of each selection, and save the result to a register.

See https://github.com/mawww/kakoune/blob/master/doc/pages/keys.asciidoc#changes-through-external-programs

Additional commands

Title Identifier Keybinding Commands
Pipe and replace pipe.replace | (kakoune: normal) [".selections.pipe", { +expression,register }], [".edit.insert", { register: "|", ... }]
Pipe and append pipe.append ! (kakoune: normal) [".selections.pipe", { +expression,register }], [".edit.insert", { register: "|", where: "end" , shift: "select", ... }]
Pipe and prepend pipe.prepend a-! (kakoune: normal) [".selections.pipe", { +expression,register }], [".edit.insert", { register: "|", where: "start", shift: "select", ... }]

This command:

  • accepts a register (by default, it uses pipe).
  • takes an input expression of type string.

Default keybinding: a-| (kakoune: normal)

Filter selections.

Variants

Title Identifier Keybinding Commands
Keep matching selections filter.regexp a-k (kakoune: normal) [".selections.filter", { defaultExpression: "/" , ... }]
Clear matching selections filter.regexp.inverse s-a-k (kakoune: normal) [".selections.filter", { defaultExpression: "/", inverse: true, ... }]
Clear secondary selections clear.secondary , (kakoune: normal) [".selections.filter", { expression: "i === count" , ... }]
Clear main selections clear.main a-, (kakoune: normal) [".selections.filter", { expression: "i !== count" , ... }]

This command:

  • accepts an argument of type { expression?: string }.
  • may be repeated with a given number of repetitions.
  • takes an argument defaultExpression of type string.
  • takes an argument interactive of type boolean.
  • takes an argument inverse of type boolean.

Default keybinding: $ (kakoune: normal)

Select within selections.

Variants

Title Identifier Keybinding Command
Leap or select select.orLeap s (kakoune: normal) [".ifEmpty", { then: [[".seek.leap", { ... }]], otherwise: [[".selections.select", { ... }]] }]

This command:

  • accepts an argument of type { re?: string | RegExp }.
  • takes an argument interactive of type boolean.

Split selections.

This command:

  • accepts an argument of type { re?: string | RegExp }.
  • takes an argument excludeEmpty of type boolean.
  • takes an argument interactive of type boolean.

Default keybinding: s-s (kakoune: normal)

Split selections at line boundaries.

Variants

Title Identifier Keybinding Command
Leap or select backward splitLines.orLeap.backward a-s (kakoune: normal) [".ifEmpty", { then: [[".seek.leap", { direction: -1, ... }]], otherwise: [[".selections.splitLines", { ... }]] }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument excludeEol of type boolean.

Expand to lines.

Expand selections to contain full lines (including end-of-line characters).

Default keybinding: x (kakoune: normal)

Trim lines.

Trim selections to only contain full lines (from start to line break).

Default keybinding: a-x (kakoune: normal)

Trim whitespace.

Trim whitespace at beginning and end of selections.

Default keybinding: _ (kakoune: normal)

Reduce selections to their cursor.

Variant

Title Identifier Keybinding Command
Reduce selections to their ends reduce.edges s-a-s (kakoune: normal) [".selections.reduce", { where: "both", empty: false, ... }]

This command:

  • takes an argument empty of type boolean.
  • takes an argument where of type "active" | "anchor" | "start" | "end" | "both".

Default keybinding: ; (kakoune: normal)

Change direction of selections.

Variants

Title Identifier Keybinding Command
Forward selections faceForward a-: (kakoune: normal) [".selections.changeDirection", { direction: 1 }]
Backward selections faceBackward [".selections.changeDirection", { direction: -1 }]

Default keybinding: a-; (kakoune: normal)

Reverse selections.

Variants

Title Identifier Command
Order selections descending orderDescending [".selections.changeOrder", { direction: 1 }]
Order selections ascending orderAscending [".selections.changeOrder", { direction: -1 }]

Sort selections.

This command:

  • takes an input expression of type string.

Copy selections below.

Variant

Title Identifier Keybinding Command
Copy selections above copy.above s-a-c (kakoune: normal) [".selections.copy", { direction: -1 }]

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: s-c (kakoune: normal)

Merge contiguous selections.

Default keybinding: a-_ (kakoune: normal)

Open selected file.

Toggle selection indices.

Variants

Title Identifier Command
Show selection indices showIndices [".selections.toggleIndices", { display: true , ... }]
Hide selection indices hideIndices [".selections.toggleIndices", { display: false, ... }]

This command:

  • takes an argument display of type boolean | undefined.
  • takes an argument until of type AutoDisposable.Event[].

Default keybinding: enter (dance: normal)

Rotate selection indices and contents.

Rotate selections clockwise.

The following keybinding is also available:

Title Identifier Keybinding Command
Rotate selections counter-clockwise both.reverse a-( (kakoune: normal) [".selections.rotate.both", { reverse: true }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument reverse of type boolean.

Default keybinding: a-) (kakoune: normal)

Rotate selections clockwise (contents only).

The following command is also available:

Title Identifier Command
Rotate selections counter-clockwise (contents only) contents.reverse [".selections.rotate.contents", { reverse: true }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument reverse of type boolean.

Rotate selections clockwise (selections only).

The following keybinding is also available:

Title Identifier Keybinding Command
Rotate selections counter-clockwise (selections only) selections.reverse ( (kakoune: normal) [".selections.rotate.selections", { reverse: true }]

This command:

  • may be repeated with a given number of repetitions.
  • takes an argument reverse of type boolean.

Default keybinding: ) (kakoune: normal)

Moving the editor view.

Predefined keybindings

Title Keybinding Command
Show view menu v (kakoune: normal) [".openMenu", { menu: "view", ... }]
Show view menu (locked) s-v (kakoune: normal) [".openMenu", { menu: "view", locked: true, ... }]

Reveals a position based on the main cursor.

This command:

  • takes an argument at of type "top" | "center" | "bottom".