-
Notifications
You must be signed in to change notification settings - Fork 56
Helix support
Dance has limited support for Helix features.
Some of the features below are only available if the tree-sitter-api
extension (currently only available as a .vsix
) is installed.
-
dance.seek.askObject
(typically invoked througha-i
ora-a
) now accepts a custom pattern:(?#textobject=...)
with...
a supported capture without the.inside
/.around
suffix.Usage with
a-i
anda-a
Add this to
settings.json
to add new entries to theobject
menu, used bya-i
anda-a
:"dance.menus": { "object": { "items": { "t": { "text": "class", "command": "dance.seek.object", "args": [{ "input": "(?#textobject=class)" }], }, "f": { "text": "function", "command": "dance.seek.object", "args": [{ "input": "(?#textobject=function)" }], }, "A": { "text": "parameter", "command": "dance.seek.object", "args": [{ "input": "(?#textobject=parameter)" }], }, "c": { "text": "comment", "command": "dance.seek.object", "args": [{ "input": "(?#textobject=comment)" }], }, "T": { "text": "test", "command": "dance.seek.object", "args": [{ "input": "(?#textobject=test)" }], }, } }, },
Note that
A
is assigned toparameter
rather thana
sincea
is already defined by the default Dance config. -
dance.seek.syntax.{next,previous,parent,child}.experimental
can be used to navigate the Tree Sitter syntax tree. Unlike thetextobject
query above, however, this command does not use Helix textobjects and therefore navigates in very small increments.
-
v
can be defined inkeybindings.json
using the following configuration:{ "key": "v", "command": "dance.modes.set.select", "when": "editorTextFocus && dance.mode == 'normal'", },
- Helix uses the "old" definition of
x
(and co.), while Dance uses the new one. Refer to these issues for more information: https://github.com/helix-editor/helix/issues/165, https://github.com/71/dance/issues/319, https://github.com/71/dance/issues/281.