From 10e50a9273ca7ef6a090e8f190a54df8f222a66b Mon Sep 17 00:00:00 2001 From: Strackeror Date: Thu, 18 Jul 2024 18:53:31 +0200 Subject: [PATCH] PR Fixes --- .vscode/launch.json | 3 +- extensions/helix/package.build.ts | 17 ++++++--- extensions/helix/package.json | 10 ++++- meta.ts | 7 +++- package.build.ts | 10 +++-- package.json | 11 ++++-- src/api/data/commands.yaml | 10 ++--- src/api/modes.ts | 9 +---- src/commands/README.md | 61 ++++++++++++++++--------------- src/commands/layouts/azerty.fr.md | 61 ++++++++++++++++--------------- src/commands/layouts/qwerty.md | 61 ++++++++++++++++--------------- src/commands/seek.ts | 8 ++-- src/commands/select.ts | 1 + 13 files changed, 146 insertions(+), 123 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 850be651..49dead84 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,12 +10,11 @@ "outFiles": ["${workspaceFolder}/out/**/*.js"], }, { - "name": "Launch extension with helix keybinds", + "name": "Launch extension with Helix keybindings", "type": "extensionHost", "request": "launch", "runtimeExecutable": "${execPath}", "args": [ - "${workspaceFolder}/.vscode-test", "--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentPath=${workspaceFolder}/extensions/helix/", ], diff --git a/extensions/helix/package.build.ts b/extensions/helix/package.build.ts index c2930f75..717d8f21 100644 --- a/extensions/helix/package.build.ts +++ b/extensions/helix/package.build.ts @@ -3,7 +3,7 @@ import { Builder, generateIgnoredKeybinds } from "../../meta"; import * as fs from "fs/promises"; -import { SelectionBehavior } from "../../src/api"; +import { extensionId } from "../../src/utils/constants"; const version = "0.1.0", preRelease = 1, @@ -14,16 +14,23 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({ // Common package.json properties. // ========================================================================== - name: "dance-helix-keybinds", - description: "Helix keybindings for dance", + name: "dance-helix-keybindingss", + description: "Helix keybindings for Dance", version, license: "ISC", - + extensionDependencies: [extensionId], author: { name: "Grégoire Geis", email: "opensource@gregoirege.is", }, + contributors: [ + { + name: "Rémi Lavergne", + url: "https://github.com/Strackeror", + }, + ], + repository: { type: "git", url: "https://github.com/71/dance.git", @@ -33,7 +40,7 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({ vscode: "^1.63.0", }, - displayName: "Dance", + displayName: "Dance (Helix keybindings)", publisher: "gregoire", categories: ["Keymaps", "Other"], readme: "README.md", diff --git a/extensions/helix/package.json b/extensions/helix/package.json index d65e9378..6e5187ae 100644 --- a/extensions/helix/package.json +++ b/extensions/helix/package.json @@ -1,12 +1,18 @@ { - "name": "dance-helix-keybinds", - "description": "Helix keybindings for dance", + "name": "dance-helix-keybindingss", + "description": "Helix keybindings for Dance", "version": "0.1.0", "license": "ISC", "author": { "name": "Grégoire Geis", "email": "opensource@gregoirege.is" }, + "contributors": [ + { + "name": "Rémi Lavergne", + "url": "https://github.com/Strackeror" + } + ], "repository": { "type": "git", "url": "https://github.com/71/dance.git" diff --git a/meta.ts b/meta.ts index f6378d4d..b23a9b2c 100644 --- a/meta.ts +++ b/meta.ts @@ -653,8 +653,13 @@ function getKeybindings(module: Omit): Buil ].sort((a, b) => a.command.localeCompare(b.command)); } +/** + * Takes a list of keybindings and generates `dance.ignore` keybindings for + * common keys that are unused. This is used for modes where we don't want the + * user to be able to type + */ export function generateIgnoredKeybinds( - currentKeybindings: Builder.Keybinding[], + currentKeybindings: readonly Builder.Keybinding[], when: string, ): Builder.Keybinding[] { const alphanum = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"], diff --git a/package.build.ts b/package.build.ts index 8c7ede28..48064e30 100644 --- a/package.build.ts +++ b/package.build.ts @@ -22,7 +22,7 @@ const builtinModesAreDeprecatedMessage = "Built-in modes are deprecated. Use `#dance.modes#` instead."; const modeNamePattern = { - pattern: /^[a-zA-Z]\w*\/?\w*$/.source, + pattern: /^[a-zA-Z]\w*(\/\w+)?$/.source, patternErrorMessage: "", }; @@ -129,7 +129,11 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({ "publish": "vsce publish --allow-star-activation", "package:pre": `vsce package --allow-star-activation --pre-release --no-git-tag-version --no-update-package-json ${version.replace(/\d+$/, "$&" + preRelease.toString().padStart(3, "0"))}`, "publish:pre": `vsce publish --allow-star-activation --pre-release --no-git-tag-version --no-update-package-json ${version.replace(/\d+$/, "$&" + preRelease.toString().padStart(3, "0"))}`, - "package-helix": `cd extensions/helix && npm run package`, + + "package-helix": `cd extensions/helix && yarn run package`, + "publish-helix": `cd extensions/helix && yarn run publish`, + "package-helix:pre": `cd extensions/helix && yarn run package:pre`, + "publish-helix:pre": `cd extensions/helix && yarn run publish:pre`, }, devDependencies: { @@ -763,7 +767,7 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({ return [ ...keybindings, - ...generateIgnoredKeybinds(keybindings,`editorTextFocus && dance.mode == 'normal'`), + ...generateIgnoredKeybinds(keybindings, `editorTextFocus && dance.mode == 'normal'`), ]; })(), diff --git a/package.json b/package.json index 06b48140..ac5cc124 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,10 @@ "publish": "vsce publish --allow-star-activation", "package:pre": "vsce package --allow-star-activation --pre-release --no-git-tag-version --no-update-package-json 0.5.15001", "publish:pre": "vsce publish --allow-star-activation --pre-release --no-git-tag-version --no-update-package-json 0.5.15001", - "package-helix": "cd extensions/helix && npm run package" + "package-helix": "cd extensions/helix && yarn run package", + "publish-helix": "cd extensions/helix && yarn run publish", + "package-helix:pre": "cd extensions/helix && yarn run package:pre", + "publish-helix:pre": "cd extensions/helix && yarn run publish:pre" }, "devDependencies": { "@types/glob": "^7.2.0", @@ -94,7 +97,7 @@ "scope": "language-overridable", "default": "normal", "description": "Controls which mode is set by default when an editor is opened.", - "pattern": "^[a-zA-Z]\\w*\\/?\\w*$", + "pattern": "^[a-zA-Z]\\w*(\\/\\w+)?$", "patternErrorMessage": "" }, "dance.modes": { @@ -103,7 +106,7 @@ "additionalProperties": { "type": "object", "propertyNames": { - "pattern": "^[a-zA-Z]\\w*\\/?\\w*$", + "pattern": "^[a-zA-Z]\\w*(\\/\\w+)?$", "patternErrorMessage": "" }, "properties": { @@ -113,7 +116,7 @@ "null" ], "description": "Controls how default configuration options are obtained for this mode. Specify a string to inherit from the mode with the given name, and null to inherit from the VS Code configuration.", - "pattern": "^[a-zA-Z]\\w*\\/?\\w*$", + "pattern": "^[a-zA-Z]\\w*(\\/\\w+)?$", "patternErrorMessage": "" }, "cursorStyle": { diff --git a/src/api/data/commands.yaml b/src/api/data/commands.yaml index b53500eb..ac0567ca 100644 --- a/src/api/data/commands.yaml +++ b/src/api/data/commands.yaml @@ -1814,15 +1814,15 @@ select.line.below.extend: title: en: Extend to line below - doc: - en: | - Extend to line below. - keys: qwerty: |- `x` (helix: normal) `x` (helix: select) + doc: + en: |+ + Extend to line below. + select.lineEnd: title: en: Select to line end @@ -2759,7 +2759,7 @@ anonymous: en: Open match menu with extend commands: |- - [".openMenu", { menu: "match", pass: [{shift: "extend"}] }] + [".openMenu", { menu: "match", pass: [{ shift: "extend" }] }] keys: qwerty: |- diff --git a/src/api/modes.ts b/src/api/modes.ts index f258d74f..408299ea 100644 --- a/src/api/modes.ts +++ b/src/api/modes.ts @@ -70,15 +70,10 @@ function findMode(modeName: string, context?: Context) { split = currentMode.name.split("/"); if (split.length === 2) { const namespacedMode = context.extension.modes.get(`${split[0]}/${modeName}`); - if (namespacedMode) { + if (namespacedMode !== undefined) { return namespacedMode; } } - const directMode = context.extension.modes.get(modeName); - if (directMode) { - return directMode; - } - - return undefined; + return context.extension.modes.get(modeName); } diff --git a/src/commands/README.md b/src/commands/README.md index a4c4f366..1db7dff0 100644 --- a/src/commands/README.md +++ b/src/commands/README.md @@ -154,27 +154,27 @@ selections are empty 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.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.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')End (editorTextFocus && dance.mode == 'select') -select.lineStart.extendExtend to line startShift+Alt+H (editorTextFocus && dance.mode == 'normal')Shift+Home (editorTextFocus && dance.mode == 'normal')Home (editorTextFocus && dance.mode == 'select') -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.lineEnd.extendExtend to line endShift+Alt+L (editorTextFocus && dance.mode == 'normal')Shift+End (editorTextFocus && dance.mode == 'normal')End (editorTextFocus && dance.mode == 'select') +select.lineStart.extendExtend to line startShift+Alt+H (editorTextFocus && dance.mode == 'normal')Shift+Home (editorTextFocus && dance.mode == 'normal')Home (editorTextFocus && dance.mode == 'select') +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') @@ -1018,10 +1018,10 @@ Update selections based on the text surrounding them. #### Predefined keybindings -| Title | Keybinding | Command | -| --------------------------- | ------------------- | ------------------------------------------------------------- | -| Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | -| Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{shift: "extend"}] }]` | +| Title | Keybinding | Command | +| --------------------------- | ------------------- | --------------------------------------------------------------- | +| Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | +| Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{ shift: "extend" }] }]` | @@ -1277,10 +1277,11 @@ This command: -### [`select.line.below.extend`](./select.ts#L346-L350) +### [`select.line.below.extend`](./select.ts#L346-L351) Extend to line below. + This command: - may be repeated with a given number of repetitions. @@ -1289,7 +1290,7 @@ Default keybinding: `x` (helix: normal) -### [`select.line.above`](./select.ts#L377-L380) +### [`select.line.above`](./select.ts#L378-L381) Select line above. @@ -1298,7 +1299,7 @@ This command: -### [`select.line.above.extend`](./select.ts#L404-L407) +### [`select.line.above.extend`](./select.ts#L405-L408) Extend to line above. @@ -1307,7 +1308,7 @@ This command: -### [`select.lineStart`](./select.ts#L453-L475) +### [`select.lineStart`](./select.ts#L454-L476) Select to line start. @@ -1332,7 +1333,7 @@ Default keybinding: `a-h` (kakoune: normal) -### [`select.lineEnd`](./select.ts#L500-L522) +### [`select.lineEnd`](./select.ts#L501-L523) Select to line end. @@ -1355,7 +1356,7 @@ Default keybinding: `a-l` (kakoune: normal) -### [`select.lastLine`](./select.ts#L550-L560) +### [`select.lastLine`](./select.ts#L551-L561) Select to last line. @@ -1368,7 +1369,7 @@ Select to last line. -### [`select.firstVisibleLine`](./select.ts#L571-L581) +### [`select.firstVisibleLine`](./select.ts#L572-L582) Select to first visible line. @@ -1381,7 +1382,7 @@ Select to first visible line. -### [`select.middleVisibleLine`](./select.ts#L588-L598) +### [`select.middleVisibleLine`](./select.ts#L589-L599) Select to middle visible line. @@ -1394,7 +1395,7 @@ Select to middle visible line. -### [`select.lastVisibleLine`](./select.ts#L605-L615) +### [`select.lastVisibleLine`](./select.ts#L606-L616) Select to last visible line. diff --git a/src/commands/layouts/azerty.fr.md b/src/commands/layouts/azerty.fr.md index fe995d8d..b79975e5 100644 --- a/src/commands/layouts/azerty.fr.md +++ b/src/commands/layouts/azerty.fr.md @@ -139,27 +139,27 @@ selections are empty 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.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.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')End (editorTextFocus && dance.mode == 'select') -select.lineStart.extendExtend to line startShift+Alt+H (editorTextFocus && dance.mode == 'normal')Shift+Home (editorTextFocus && dance.mode == 'normal')Home (editorTextFocus && dance.mode == 'select') -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.lineEnd.extendExtend to line endShift+Alt+L (editorTextFocus && dance.mode == 'normal')Shift+End (editorTextFocus && dance.mode == 'normal')End (editorTextFocus && dance.mode == 'select') +select.lineStart.extendExtend to line startShift+Alt+H (editorTextFocus && dance.mode == 'normal')Shift+Home (editorTextFocus && dance.mode == 'normal')Home (editorTextFocus && dance.mode == 'select') +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') @@ -1003,10 +1003,10 @@ Update selections based on the text surrounding them. #### Predefined keybindings -| Title | Keybinding | Command | -| --------------------------- | ------------------- | ------------------------------------------------------------- | -| Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | -| Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{shift: "extend"}] }]` | +| Title | Keybinding | Command | +| --------------------------- | ------------------- | --------------------------------------------------------------- | +| Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | +| Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{ shift: "extend" }] }]` | @@ -1262,10 +1262,11 @@ This command: -### [`select.line.below.extend`](../select.ts#L346-L350) +### [`select.line.below.extend`](../select.ts#L346-L351) Extend to line below. + This command: - may be repeated with a given number of repetitions. @@ -1274,7 +1275,7 @@ Default keybinding: `x` (helix: normal) -### [`select.line.above`](../select.ts#L377-L380) +### [`select.line.above`](../select.ts#L378-L381) Select line above. @@ -1283,7 +1284,7 @@ This command: -### [`select.line.above.extend`](../select.ts#L404-L407) +### [`select.line.above.extend`](../select.ts#L405-L408) Extend to line above. @@ -1292,7 +1293,7 @@ This command: -### [`select.lineStart`](../select.ts#L453-L475) +### [`select.lineStart`](../select.ts#L454-L476) Select to line start. @@ -1317,7 +1318,7 @@ Default keybinding: `a-h` (kakoune: normal) -### [`select.lineEnd`](../select.ts#L500-L522) +### [`select.lineEnd`](../select.ts#L501-L523) Select to line end. @@ -1340,7 +1341,7 @@ Default keybinding: `a-l` (kakoune: normal) -### [`select.lastLine`](../select.ts#L550-L560) +### [`select.lastLine`](../select.ts#L551-L561) Select to last line. @@ -1353,7 +1354,7 @@ Select to last line. -### [`select.firstVisibleLine`](../select.ts#L571-L581) +### [`select.firstVisibleLine`](../select.ts#L572-L582) Select to first visible line. @@ -1366,7 +1367,7 @@ Select to first visible line. -### [`select.middleVisibleLine`](../select.ts#L588-L598) +### [`select.middleVisibleLine`](../select.ts#L589-L599) Select to middle visible line. @@ -1379,7 +1380,7 @@ Select to middle visible line. -### [`select.lastVisibleLine`](../select.ts#L605-L615) +### [`select.lastVisibleLine`](../select.ts#L606-L616) Select to last visible line. diff --git a/src/commands/layouts/qwerty.md b/src/commands/layouts/qwerty.md index 223f97eb..647af465 100644 --- a/src/commands/layouts/qwerty.md +++ b/src/commands/layouts/qwerty.md @@ -139,27 +139,27 @@ selections are empty 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.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.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')End (editorTextFocus && dance.mode == 'select') -select.lineStart.extendExtend to line startShift+Alt+H (editorTextFocus && dance.mode == 'normal')Shift+Home (editorTextFocus && dance.mode == 'normal')Home (editorTextFocus && dance.mode == 'select') -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.lineEnd.extendExtend to line endShift+Alt+L (editorTextFocus && dance.mode == 'normal')Shift+End (editorTextFocus && dance.mode == 'normal')End (editorTextFocus && dance.mode == 'select') +select.lineStart.extendExtend to line startShift+Alt+H (editorTextFocus && dance.mode == 'normal')Shift+Home (editorTextFocus && dance.mode == 'normal')Home (editorTextFocus && dance.mode == 'select') +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') @@ -1003,10 +1003,10 @@ Update selections based on the text surrounding them. #### Predefined keybindings -| Title | Keybinding | Command | -| --------------------------- | ------------------- | ------------------------------------------------------------- | -| Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | -| Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{shift: "extend"}] }]` | +| Title | Keybinding | Command | +| --------------------------- | ------------------- | --------------------------------------------------------------- | +| Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | +| Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{ shift: "extend" }] }]` | @@ -1262,10 +1262,11 @@ This command: -### [`select.line.below.extend`](../select.ts#L346-L350) +### [`select.line.below.extend`](../select.ts#L346-L351) Extend to line below. + This command: - may be repeated with a given number of repetitions. @@ -1274,7 +1275,7 @@ Default keybinding: `x` (helix: normal) -### [`select.line.above`](../select.ts#L377-L380) +### [`select.line.above`](../select.ts#L378-L381) Select line above. @@ -1283,7 +1284,7 @@ This command: -### [`select.line.above.extend`](../select.ts#L404-L407) +### [`select.line.above.extend`](../select.ts#L405-L408) Extend to line above. @@ -1292,7 +1293,7 @@ This command: -### [`select.lineStart`](../select.ts#L453-L475) +### [`select.lineStart`](../select.ts#L454-L476) Select to line start. @@ -1317,7 +1318,7 @@ Default keybinding: `a-h` (kakoune: normal) -### [`select.lineEnd`](../select.ts#L500-L522) +### [`select.lineEnd`](../select.ts#L501-L523) Select to line end. @@ -1340,7 +1341,7 @@ Default keybinding: `a-l` (kakoune: normal) -### [`select.lastLine`](../select.ts#L550-L560) +### [`select.lastLine`](../select.ts#L551-L561) Select to last line. @@ -1353,7 +1354,7 @@ Select to last line. -### [`select.firstVisibleLine`](../select.ts#L571-L581) +### [`select.firstVisibleLine`](../select.ts#L572-L582) Select to first visible line. @@ -1366,7 +1367,7 @@ Select to first visible line. -### [`select.middleVisibleLine`](../select.ts#L588-L598) +### [`select.middleVisibleLine`](../select.ts#L589-L599) Select to middle visible line. @@ -1379,7 +1380,7 @@ Select to middle visible line. -### [`select.lastVisibleLine`](../select.ts#L605-L615) +### [`select.lastVisibleLine`](../select.ts#L606-L616) Select to last visible line. diff --git a/src/commands/seek.ts b/src/commands/seek.ts index da5bb9e7..4ab729cb 100644 --- a/src/commands/seek.ts +++ b/src/commands/seek.ts @@ -13,10 +13,10 @@ import { SyntaxNode, Tree, TreeSitter } from "../utils/tree-sitter"; * * #### Predefined keybindings * - * | Title | Keybinding | Command | - * | --------------------------- | ------------------- | ------------------------------------------------------------- | - * | Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | - * | Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{shift: "extend"}] }]` | + * | Title | Keybinding | Command | + * | --------------------------- | ------------------- | --------------------------------------------------------------- | + * | Open match menu | `m` (helix: normal) | `[".openMenu", { menu: "match" }]` | + * | Open match menu with extend | `m` (helix: select) | `[".openMenu", { menu: "match", pass: [{ shift: "extend" }] }]` | */ declare module "./seek"; diff --git a/src/commands/select.ts b/src/commands/select.ts index 41d7ed17..620a259f 100644 --- a/src/commands/select.ts +++ b/src/commands/select.ts @@ -345,6 +345,7 @@ export function line_below(_: Context, count: number) { /** * Extend to line below. + * * @keys `x` (helix: normal), `x` (helix: select) */ export function line_below_extend(_: Context, count: number) {