Skip to content

Commit

Permalink
commands: experimental/wip support for helix-like keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
71 committed Apr 23, 2023
1 parent 882ca13 commit 38001b1
Show file tree
Hide file tree
Showing 14 changed files with 612 additions and 118 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ module.exports = {
ecmaVersion: 2019,
sourceType: "module",
},
ignorePatterns: ["out/", "*.js"],
ignorePatterns: [
"out/",
"*.js",
"tree-sitter-api.d.ts",
],
overrides: [
{
files: ["commands/index.ts"],
Expand Down
9 changes: 9 additions & 0 deletions package.build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({
"typescript": "^4.8.4",
"unexpected": "^13.0.0",
"vsce": "^2.7.0",
"web-tree-sitter": "^0.20.8",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"yaml": "^2.1.1",
Expand Down Expand Up @@ -522,6 +523,14 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({
text: "to file whose name is selected",
command: "dance.selections.open",
},
"d": {
text: "to definition",
command: "editor.action.revealDefinition",
},
"r": {
text: "to references",
command: "editor.action.goToReferences",
},
".": {
text: "to last buffer modification position",
command: "dance.selections.restore",
Expand Down
54 changes: 54 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions src/api/data/commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,51 @@ seek.object:
| 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" }] }]` |
seek.syntax.child.experimental:
title:
en: Select child syntax object

commands: |-
[".seek.syntax.experimental", { where: "child" }]
seek.syntax.experimental:
title:
en: Select syntax object

doc:
en: |
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" }]` |
seek.syntax.next.experimental:
title:
en: Select next syntax object

commands: |-
[".seek.syntax.experimental", { where: "next" }]
seek.syntax.parent.experimental:
title:
en: Select parent syntax object

commands: |-
[".seek.syntax.experimental", { where: "parent" }]
seek.syntax.previous.experimental:
title:
en: Select previous syntax object

commands: |-
[".seek.syntax.experimental", { where: "previous" }]
seek.word:
title:
en: Select to next word start
Expand Down
Loading

0 comments on commit 38001b1

Please sign in to comment.