Skip to content

Latest commit

 

History

History
 
 

commands

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')Shift+7 (editorTextFocus && dance.mode == 'visual')
edit.case.swapSwap caseShift+` (editorTextFocus && dance.mode == 'normal')Shift+` (editorTextFocus && dance.mode == 'visual')
edit.case.toLowerTransform to lower case` (editorTextFocus && dance.mode == 'normal')` (editorTextFocus && dance.mode == 'visual')
edit.case.toUpperTransform to upper caseAlt+` (editorTextFocus && dance.mode == 'normal')Alt+` (editorTextFocus && dance.mode == 'visual')
edit.copyIndentationCopy indentationShift+Alt+7 (editorTextFocus && dance.mode == 'normal')Shift+Alt+7 (editorTextFocus && dance.mode == 'visual')
edit.deindentDeindent selected linesShift+Alt+, (editorTextFocus && dance.mode == 'normal')Shift+Alt+, (editorTextFocus && dance.mode == 'visual')
edit.deindent.withIncompleteDeindent selected lines (including incomplete indent)Shift+, (editorTextFocus && dance.mode == 'normal')Shift+, (editorTextFocus && dance.mode == 'visual')
edit.deleteDeleteAlt+D (editorTextFocus && dance.mode == 'normal')Alt+D (editorTextFocus && dance.mode == 'visual')
edit.delete-insertDelete and switch to InsertAlt+C (editorTextFocus && dance.mode == 'normal')Alt+C (editorTextFocus && dance.mode == 'visual')
edit.newLine.above.insertInsert new line above and switch to insertShift+O (editorTextFocus && dance.mode == 'normal')Shift+O (editorTextFocus && dance.mode == 'visual')
edit.newLine.below.insertInsert new line below and switch to insertO (editorTextFocus && dance.mode == 'normal')O (editorTextFocus && dance.mode == 'visual')
edit.paste.afterPaste after
edit.paste.after.selectPaste after and selectP (editorTextFocus && dance.mode == 'normal')P (editorTextFocus && dance.mode == 'visual')
edit.paste.beforePaste before
edit.paste.before.selectPaste before and selectShift+P (editorTextFocus && dance.mode == 'normal')Shift+P (editorTextFocus && dance.mode == 'visual')
edit.pasteAll.afterPaste all after
edit.pasteAll.after.selectPaste all after and selectAlt+P (editorTextFocus && dance.mode == 'normal')Alt+P (editorTextFocus && dance.mode == 'visual')
edit.pasteAll.beforePaste all before
edit.pasteAll.before.selectPaste all before and selectShift+Alt+P (editorTextFocus && dance.mode == 'normal')Shift+Alt+P (editorTextFocus && dance.mode == 'visual')
edit.selectRegister-insertPick register and replaceCtrl+R (editorTextFocus && dance.mode == 'normal')Ctrl+R (editorTextFocus && dance.mode == 'visual')
edit.yank-deleteCopy and deleteD (editorTextFocus && dance.mode == 'normal')D (editorTextFocus && dance.mode == 'visual')
edit.yank-delete-insertCopy, delete and switch to InsertC (editorTextFocus && dance.mode == 'normal')C (editorTextFocus && dance.mode == 'visual')
edit.yank-replaceCopy and replaceShift+R (editorTextFocus && dance.mode == 'normal')Shift+R (editorTextFocus && dance.mode == 'visual')
edit.indentIndent selected linesShift+. (editorTextFocus && dance.mode == 'normal')Shift+. (editorTextFocus && dance.mode == 'visual')
edit.indent.withEmptyIndent selected lines (including empty lines)Shift+Alt+. (editorTextFocus && dance.mode == 'normal')Shift+Alt+. (editorTextFocus && dance.mode == 'visual')
edit.insertInsert contents of registerShift+Alt+R (editorTextFocus && dance.mode == 'normal')
edit.joinJoin linesShift+J (editorTextFocus && dance.mode == 'normal')Shift+J (editorTextFocus && dance.mode == 'visual')
edit.join.selectJoin lines and select inserted separatorsShift+Alt+J (editorTextFocus && dance.mode == 'normal')
edit.newLine.aboveInsert new line above each selection
edit.newLine.belowInsert new line below each selection
edit.replaceCharactersReplace charactersR (editorTextFocus && dance.mode == 'normal')R (editorTextFocus && dance.mode == 'visual')
historyhistory.repeat.seekRepeat last seekAlt+. (editorTextFocus && dance.mode == 'normal')
history.repeat.selectionRepeat last selection change
history.recording.playReplay recordingQ (editorTextFocus && dance.mode == 'normal')Q (editorTextFocus && dance.mode == 'visual')
history.recording.startStart recordingShift+Q (editorTextFocus && dance.mode == 'normal' && !dance.isRecording)Shift+Q (editorTextFocus && dance.mode == 'visual' && !dance.isRecording)
history.recording.stopStop recordingEscape (editorTextFocus && dance.mode == 'normal' && dance.isRecording)Shift+Q (editorTextFocus && dance.mode == 'normal' && dance.isRecording)Escape (editorTextFocus && dance.mode == 'visual' && dance.isRecording)Shift+Q (editorTextFocus && dance.mode == 'visual' && dance.isRecording)
history.redoRedoShift+U (editorTextFocus && dance.mode == 'normal')Shift+U (editorTextFocus && dance.mode == 'visual')
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'). (editorTextFocus && dance.mode == 'visual')NumPad_Decimal (editorTextFocus && dance.mode == 'visual')
history.undoUndoU (editorTextFocus && dance.mode == 'normal')U (editorTextFocus && dance.mode == 'visual')
history.undo.selectionsUndo a change of selectionsAlt+U (editorTextFocus && dance.mode == 'normal')
keybindingskeybindings.setupSet up Dance keybindings
matchmatch.surroundAdd stuff surround
match.surrounddeleteDelete stuff surround
match.surroundreplaceReplace stuff surround
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')Shift+' (editorTextFocus && dance.mode == 'visual')
updateCountUpdate Dance count
updateRegisterUpdate the contents of a register
modesmodes.insert.afterInsert afterA (editorTextFocus && dance.mode == 'normal')A (editorTextFocus && dance.mode == 'visual')
modes.insert.beforeInsert beforeI (editorTextFocus && dance.mode == 'normal')I (editorTextFocus && dance.mode == 'visual')
modes.insert.lineEndInsert at line endShift+A (editorTextFocus && dance.mode == 'normal')Shift+A (editorTextFocus && dance.mode == 'visual')
modes.insert.lineStartInsert at line startShift+I (editorTextFocus && dance.mode == 'normal')Shift+I (editorTextFocus && dance.mode == 'visual')
modes.set.insertSet mode to Insert
modes.set.normalSet mode to NormalEscape (editorTextFocus && dance.mode == 'insert')Escape (editorTextFocus && dance.mode == 'visual')V (editorTextFocus && dance.mode == 'visual')
modes.set.temporarily.insertTemporary Insert modeCtrl+V (editorTextFocus && dance.mode == 'normal')
modes.set.temporarily.normalTemporary Normal modeCtrl+V (editorTextFocus && dance.mode == 'insert')
modes.set.visualSet mode to VisualV (editorTextFocus && dance.mode == 'normal')
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')/ (editorTextFocus && dance.mode == 'visual')NumPad_Divide (editorTextFocus && dance.mode == 'visual')
search.backwardSearch backwardShift+/ (editorTextFocus && dance.mode == 'normal')
search.backward.extendSearch backward (extend)Shift+Alt+/ (editorTextFocus && dance.mode == 'normal')
search.extendSearch (extend)Alt+/ (editorTextFocus && dance.mode == 'normal')
search.next.addAdd next matchAlt+N (editorTextFocus && dance.mode == 'normal')N (editorTextFocus && dance.mode == 'visual')
search.previousSelect previous matchShift+N (editorTextFocus && dance.mode == 'normal')
search.previous.addAdd previous matchShift+Alt+N (editorTextFocus && dance.mode == 'normal')Shift+N (editorTextFocus && dance.mode == 'visual')
search.selection.smartSearch current selection (smart)Shift+8 (editorTextFocus && dance.mode == 'normal')NumPad_Multiply (editorTextFocus && dance.mode == 'normal')Shift+8 (editorTextFocus && dance.mode == 'visual')NumPad_Multiply (editorTextFocus && dance.mode == 'visual')
search.selectionSearch current selectionShift+Alt+8 (editorTextFocus && dance.mode == 'normal')Alt+NumPad_Multiply (editorTextFocus && dance.mode == 'normal')
seekseek.enclosingSelect to next enclosing characterShift+M (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)Shift+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 == 'visual')
seek.enclosing.extend.backwardExtend to previous enclosing characterAlt+M (editorTextFocus && dance.mode == 'visual')
seek.extendExtend to character (excluded)T (editorTextFocus && dance.mode == 'visual')
seek.extend.backwardExtend to character (excluded, backward)Shift+T (editorTextFocus && dance.mode == 'visual')
seek.includedSelect to character (included)F (editorTextFocus && dance.mode == 'normal')
seek.included.backwardSelect to character (included, backward)Shift+F (editorTextFocus && dance.mode == 'normal')
seek.included.extendExtend to character (included)F (editorTextFocus && dance.mode == 'visual')
seek.included.extend.backwardExtend to character (included, backward)Shift+F (editorTextFocus && dance.mode == 'visual')
seek.leap.backwardLeap backward
seek.word.backwardSelect to previous word startB (editorTextFocus && dance.mode == 'normal')
seek.word.backward.extendExtend to previous word startB (editorTextFocus && dance.mode == 'visual')
seek.word.extendExtend to next word startW (editorTextFocus && dance.mode == 'visual')
seek.word.wsSelect to next WORD startShift+W (editorTextFocus && dance.mode == 'normal')
seek.word.ws.backwardSelect to previous WORD startShift+B (editorTextFocus && dance.mode == 'normal')
seek.word.ws.backward.extendExtend to previous WORD startShift+B (editorTextFocus && dance.mode == 'visual')
seek.word.ws.extendExtend to next WORD startShift+W (editorTextFocus && dance.mode == 'visual')
seek.wordEndSelect to next word endE (editorTextFocus && dance.mode == 'normal')
seek.wordEnd.extendExtend to next word endE (editorTextFocus && dance.mode == 'visual')
seek.wordEnd.wsSelect to next WORD endShift+E (editorTextFocus && dance.mode == 'normal')
seek.wordEnd.ws.extendExtend to next WORD endShift+E (editorTextFocus && dance.mode == 'visual')
seek.wordSelect to next word startW (editorTextFocus && dance.mode == 'normal')
selectselect.bufferSelect whole bufferShift+5 (editorTextFocus && dance.mode == 'normal')Shift+5 (editorTextFocus && dance.mode == 'visual')
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 belowX (editorTextFocus && dance.mode == 'normal')X (editorTextFocus && dance.mode == 'visual')
select.lineEndSelect to line end. TODO: helixAlt+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 == 'visual')Down (editorTextFocus && dance.mode == 'visual')
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+Left (editorTextFocus && dance.mode == 'normal')H (editorTextFocus && dance.mode == 'visual')Left (editorTextFocus && dance.mode == 'visual')
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+Right (editorTextFocus && dance.mode == 'normal')L (editorTextFocus && dance.mode == 'visual')Right (editorTextFocus && dance.mode == 'visual')
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 == 'visual')
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 == 'visual')Up (editorTextFocus && dance.mode == 'visual')
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')Shift+C (editorTextFocus && dance.mode == 'visual')
selections.expandToLinesExpand to linesShift+X (editorTextFocus && dance.mode == 'normal')Shift+X (editorTextFocus && dance.mode == 'visual')
selections.filterFilter selectionsShift+4 (editorTextFocus && dance.mode == 'normal')Shift+4 (editorTextFocus && dance.mode == 'visual')
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'); (editorTextFocus && dance.mode == 'visual')
selections.restoreRestore selections. TODO: Needed?Alt+Z (editorTextFocus && dance.mode == 'normal')
selections.restore.withCurrentCombine register selections with current onesAlt+Z (editorTextFocus && dance.mode == 'normal')
selections.saveSave selectionsShift+Alt+Z (editorTextFocus && dance.mode == 'normal')
selections.saveTextCopy selections textY (editorTextFocus && dance.mode == 'normal')Y (editorTextFocus && dance.mode == 'visual')
selections.selectSelect within selections
selections.clear.mainClear main selectionsAlt+, (editorTextFocus && dance.mode == 'normal')Alt+, (editorTextFocus && dance.mode == 'visual')
selections.clear.secondaryClear secondary selections, (editorTextFocus && dance.mode == 'normal'), (editorTextFocus && dance.mode == 'visual')
selections.copy.aboveCopy selections aboveShift+Alt+C (editorTextFocus && dance.mode == 'normal')Shift+Alt+C (editorTextFocus && dance.mode == 'visual')
selections.faceBackwardBackward selections
selections.faceForwardForward selectionsShift+Alt+; (editorTextFocus && dance.mode == 'normal')
selections.filter.regexpKeep matching selectionsShift+K (editorTextFocus && dance.mode == 'normal')Shift+K (editorTextFocus && dance.mode == 'visual')
selections.filter.regexp.inverseClear matching selectionsShift+Alt+K (editorTextFocus && dance.mode == 'normal')Shift+Alt+K (editorTextFocus && dance.mode == 'visual')
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')S (editorTextFocus && dance.mode == 'visual')
selections.showIndicesShow selection indices
selections.splitLines.orLeap.backwardLeap or select backwardAlt+S (editorTextFocus && dance.mode == 'normal')Alt+S (editorTextFocus && dance.mode == 'visual')
selections.sortSort selections
selections.splitSplit selectionsShift+S (editorTextFocus && dance.mode == 'normal')Shift+S (editorTextFocus && dance.mode == 'visual')
selections.splitLinesSplit selections at line boundaries
selections.toggleIndicesToggle selection indicesEnter (editorTextFocus && dance.mode == 'normal')Enter (editorTextFocus && dance.mode == 'visual')
selections.trimLinesTrim linesAlt+X (editorTextFocus && dance.mode == 'normal')
selections.trimWhitespaceTrim whitespaceShift+- (editorTextFocus && dance.mode == 'normal')Shift+- (editorTextFocus && dance.mode == 'visual')
selections.rotateselections.rotate.bothRotate selections clockwiseShift+Alt+9 (editorTextFocus && dance.mode == 'normal')
selections.rotate.contentsRotate selections clockwise (contents only)
selections.rotate.selectionsRotate selections clockwise (selections only)Shift+9 (editorTextFocus && dance.mode == 'normal')Shift+9 (editorTextFocus && dance.mode == 'visual')
selections.rotate.both.reverseRotate selections counter-clockwiseShift+Alt+0 (editorTextFocus && dance.mode == 'normal')
selections.rotate.contents.reverseRotate selections counter-clockwise (contents only)
selections.rotate.selections.reverseRotate selections counter-clockwise (selections only)Shift+0 (editorTextFocus && dance.mode == 'normal')Shift+0 (editorTextFocus && dance.mode == 'visual')
viewview.lineReveals a position based on the main cursor
windowwindow.windowMenuShow window menuCtrl+W (editorTextFocus && dance.mode == 'normal')Ctrl+W (editorTextFocus && dance.mode == 'visual')

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 (helix: normal), c-r (helix: visual) [".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 (helix: normal), s-p (helix: visual) [".edit.insert", { handleNewLine: true, where: "start", shift: "select", ... }]
Paste after and select paste.after.select p (helix: normal) , p (helix: visual) [".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 (helix: normal), s-a-p (helix: visual) [".edit.insert", { handleNewLine: true, where: "start", all: true, shift: "select", ... }]
Paste all after and select pasteAll.after.select a-p (helix: normal) , a-p (helix: visual) [".edit.insert", { handleNewLine: true, where: "end" , all: true, shift: "select", ... }]
Delete delete a-d (helix: normal) , a-d (helix: visual) [".edit.insert", { register: "_", ... }]
Delete and switch to Insert delete-insert a-c (helix: normal) , a-c (helix: visual) [".modes.set", { mode: "insert", +mode }], [".edit.insert", { register: "_", ... }]
Copy and delete yank-delete d (helix: normal) , d (helix: visual) [".selections.saveText", { +register }], [".edit.insert", { register: "_", ... }]
Copy, delete and switch to Insert yank-delete-insert c (helix: normal) , c (helix: visual) [".selections.saveText", { +register }], [".modes.set", { mode: "insert", +mode }], [".edit.insert", { register: "_", ... }]
Copy and replace yank-replace s-r (helix: normal) , s-r (helix: visual) [".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: s-j (helix: normal) s-j (helix: visual)

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: > (helix: normal) > (helix: visual)

Indent selected lines (including empty lines).

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: a-> (helix: normal) a-> (helix: visual)

Deindent selected lines.

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: a-< (helix: normal) a-< (helix: visual)

Deindent selected lines (including incomplete indent).

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: < (helix: normal) < (helix: visual)

Transform to lower case.

Default keybinding: ` (helix: normal) ` (helix: visual)

Transform to upper case.

Default keybinding: a-` (helix: normal) a-` (helix: visual)

Swap case.

Default keybinding: ~ (helix: normal) ~ (helix: visual)

Replace characters.

This command:

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

Default keybinding: r (helix: normal) r (helix: visual)

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: & (helix: normal) & (helix: visual)

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-& (helix: normal) a-& (helix: visual)

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 (helix: normal), s-o (helix: visual) [".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.

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 (helix: normal), o (helix: visual) [".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.

Interact with history.

Undo.

This command:

  • does not require an active text editor.

Default keybinding: u (helix: normal) u (helix: visual)

Redo.

This command:

  • does not require an active text editor.

Default keybinding: s-u (helix: normal) s-u (helix: visual)

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: . (helix: normal) , NumPad_Decimal (helix: normal) , . (helix: visual) , NumPad_Decimal (helix: visual)

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 (helix: normal) q (helix: visual)

Start recording.

This command:

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

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

Stop recording.

This command:

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

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

Utilities for setting up keybindings.

Set up Dance keybindings.

This command:

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

Match menu.

Title Keybinding Command
Show match menu m (helix: normal) [".openMenu", { menu: "match" }]
Show match menu m (helix: visual) [".openMenu", { menu: "match" }]

Replace stuff surround

This command:

  • takes an input input of type string.

Delete stuff surround

This command:

  • takes an input input of type string.

Add stuff surround

This command:

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

Miscellaneous commands that don't deserve their own category.

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

Keybinding Command
s-; (helix: normal), s-; (helix: visual) ["workbench.action.showCommands", { ... }]
c-c (helix: normal), c-c (helix: visual) ["editor.action.commentLine", { ... }]

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: " (helix: normal) " (helix: visual)

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 (helix: normal), NumPad0 (helix: normal), 0 (helix: visual), NumPad0 (helix: visual) [".updateCount", { addDigits: 0 }]
Add the digit 1 to the counter 1 (helix: normal), NumPad1 (helix: normal), 1 (helix: visual), NumPad1 (helix: visual) [".updateCount", { addDigits: 1 }]
Add the digit 2 to the counter 2 (helix: normal), NumPad2 (helix: normal), 2 (helix: visual), NumPad2 (helix: visual) [".updateCount", { addDigits: 2 }]
Add the digit 3 to the counter 3 (helix: normal), NumPad3 (helix: normal), 3 (helix: visual), NumPad3 (helix: visual) [".updateCount", { addDigits: 3 }]
Add the digit 4 to the counter 4 (helix: normal), NumPad4 (helix: normal), 4 (helix: visual), NumPad4 (helix: visual) [".updateCount", { addDigits: 4 }]
Add the digit 5 to the counter 5 (helix: normal), NumPad5 (helix: normal), 5 (helix: visual), NumPad5 (helix: visual) [".updateCount", { addDigits: 5 }]
Add the digit 6 to the counter 6 (helix: normal), NumPad6 (helix: normal), 6 (helix: visual), NumPad6 (helix: visual) [".updateCount", { addDigits: 6 }]
Add the digit 7 to the counter 7 (helix: normal), NumPad7 (helix: normal), 7 (helix: visual), NumPad7 (helix: visual) [".updateCount", { addDigits: 7 }]
Add the digit 8 to the counter 8 (helix: normal), NumPad8 (helix: normal), 8 (helix: visual), NumPad8 (helix: visual) [".updateCount", { addDigits: 8 }]
Add the digit 9 to the counter 9 (helix: normal), NumPad9 (helix: normal), 9 (helix: visual), NumPad9 (helix: visual) [".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 (helix: insert) , escape (helix: visual) , v (helix: visual) [".modes.set", { mode: "normal" }], ["hideSuggestWidget"]
Set mode to Insert set.insert [".modes.set", { mode: "insert" }]
Set mode to Visual set.visual v (helix: normal) [".modes.set", { mode: "visual" }]

Other variants are provided to switch to insert mode:

Title Identifier Keybinding Commands
Insert before insert.before i (helix: normal), i (helix: visual) [".selections.faceBackward", { record: false }], [".modes.set", { mode: "insert", +mode }], [".selections.reduce", { where: "start", record: false, empty: true, ... }]
Insert after insert.after a (helix: normal), a (helix: visual) [".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 (helix: normal), s-i (helix: visual) [".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 (helix: normal), s-a (helix: visual) [".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 a-/ (helix: normal) [".search", { shift: "extend", ... }]
Search backward backward ? (helix: normal) [".search", { direction: -1 , ... }]
Search backward (extend) backward.extend a-? (helix: 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: / (helix: normal) , NumPad_Divide (helix: normal) , / (helix: visual) , NumPad_Divide (helix: visual)

Search current selection.

Title Identifier Keybinding Command
Search current selection (smart) selection.smart * (helix: normal) , NumPad_Multiply (helix: normal) , * (helix: visual) , NumPad_Multiply (helix: visual) [".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-* (helix: normal) , a-NumPad_Multiply (helix: normal)

Select next match.

Title Identifier Keybinding Command
Add next match next.add a-n (helix: normal), n (helix: visual) [".search.next", { add: true, ... }]
Select previous match previous s-n (helix: normal) [".search.next", { direction: -1 , ... }]
Add previous match previous.add s-a-n (helix: normal), s-n (helix: visual) [".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 (helix: normal)

Update selections based on the text surrounding them.

Select to character (excluded).

Variants

Title Identifier Keybinding Command
Select to character (excluded, backward) backward s-t (helix: normal) [".seek", { direction: -1, ... }]
Select to character (included) included f (helix: normal) [".seek", { include: true , ... }]
Select to character (included, backward) included.backward s-f (helix: normal) [".seek", { include: true, direction: -1, ... }]
Extend to character (excluded) extend t (helix: visual) [".seek", { shift: "extend" , ... }]
Extend to character (excluded, backward) extend.backward s-t (helix: visual) [".seek", { shift: "extend", direction: -1, ... }]
Extend to character (included) included.extend f (helix: visual) [".seek", { include: true, shift: "extend" , ... }]
Extend to character (included, backward) included.extend.backward s-f (helix: visual) [".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 (helix: visual) [".seek.enclosing", { shift: "extend" , ... }]
Select to previous enclosing character enclosing.backward a-m (helix: normal) [".seek.enclosing", { direction: -1, ... }]
Extend to previous enclosing character enclosing.extend.backward a-m (helix: visual) [".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: s-m (helix: 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
Select to next WORD start word.ws s-w (helix: normal) [".seek.word", { ws: true , ... }]
Select to previous word start word.backward b (helix: normal) [".seek.word", { direction: -1, ... }]
Select to previous WORD start word.ws.backward s-b (helix: normal) [".seek.word", { ws: true, direction: -1, ... }]
Select to next word end wordEnd e (helix: normal) [".seek.word", { stopAtEnd: true , ... }]
Select to next WORD end wordEnd.ws s-e (helix: normal) [".seek.word", { stopAtEnd: true, ws: true , ... }]
Extend to next word start word.extend w (helix: visual) [".seek.word", { shift: "extend" , ... }]
Extend to next WORD start word.ws.extend s-w (helix: visual) [".seek.word", { ws: true, shift: "extend" , ... }]
Extend to previous word start word.backward.extend b (helix: visual) [".seek.word", { shift: "extend", direction: -1, ... }]
Extend to previous WORD start word.ws.backward.extend s-b (helix: visual) [".seek.word", { ws: true, shift: "extend", direction: -1, ... }]
Extend to next word end wordEnd.extend e (helix: visual) [".seek.word", { stopAtEnd: true, shift: "extend" , ... }]
Extend to next WORD end wordEnd.ws.extend s-e (helix: visual) [".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 (helix: 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.

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: % (helix: normal) % (helix: visual)

Select vertically.

TODO: Keep s-down and s-up?

Variants

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

The following keybindings are also defined:

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

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.

TODO: keep s-left and s-right?

Variants

Title Identifier Keybinding Command
Jump right right.jump l (helix: normal) , right (helix: normal) [".select.horizontally", { direction: 1, shift: "jump" , ... }]
Extend right right.extend s-right (helix: normal), l (helix: visual) , right (helix: visual) [".select.horizontally", { direction: 1, shift: "extend", ... }]
Jump left left.jump h (helix: normal) , left (helix: normal) [".select.horizontally", { direction: -1, shift: "jump" , ... }]
Extend left left.extend s-left (helix: normal) , h (helix: visual) , left (helix: visual) [".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 (helix: normal) [".select.to", { shift: "jump" , ... }]
Extend to to.extend s-g (helix: normal), g (helix: visual) [".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.

Default keybinding: x (helix: normal) x (helix: visual)

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 (helix: normal), s-home (helix: 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 (helix: normal) home (helix: normal)

Select to line end. TODO: helix

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 (helix: normal) y (helix: visual)

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-a-z (helix: normal)

Restore selections. TODO: Needed?

This command:

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

Default keybinding: a-z (helix: 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 s-k (helix: normal) , s-k (helix: visual) [".selections.filter", { defaultExpression: "/" , ... }]
Clear matching selections filter.regexp.inverse s-a-k (helix: normal), s-a-k (helix: visual) [".selections.filter", { defaultExpression: "/", inverse: true, ... }]
Clear secondary selections clear.secondary , (helix: normal) , , (helix: visual) [".selections.filter", { expression: "i === count" , ... }]
Clear main selections clear.main a-, (helix: normal) , a-, (helix: visual) [".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: $ (helix: normal) $ (helix: visual)

Select within selections.

Variants

Title Identifier Keybinding Command
Leap or select select.orLeap s (helix: normal), s (helix: visual) [".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 (helix: normal) s-s (helix: visual)

Split selections at line boundaries.

Variants

Title Identifier Keybinding Command
Leap or select backward splitLines.orLeap.backward a-s (helix: normal), a-s (helix: visual) [".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: s-x (helix: normal) s-x (helix: visual)

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: _ (helix: normal) _ (helix: visual)

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: ; (helix: normal) ; (helix: visual)

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 (helix: normal), s-a-c (helix: visual) [".selections.copy", { direction: -1 }]

This command:

  • may be repeated with a given number of repetitions.

Default keybinding: s-c (helix: normal) s-c (helix: visual)

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 (helix: normal) enter (helix: visual)

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).

TODO: ( seems to be broken. Fix it...

The following keybinding is also available:

Title Identifier Keybinding Command
Rotate selections counter-clockwise (selections only) selections.reverse ) (helix: normal), ) (helix: visual) [".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: ( (helix: normal) ( (helix: visual)

General purpose space menu.

Predefined keybindings

Title Keybinding Command
Show space menu space (helix: normal), space (helix: visual) [".openMenu", { menu: "space", ... }]

Moving the editor view.

Predefined keybindings

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

Reveals a position based on the main cursor.

This command:

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

Window menu.

Predefined keybindings

Title Identifier Keybinding Command
Show window menu windowMenu c-w (helix: normal), c-w (helix: visual) [".openMenu", { menu: "window", ... }]