Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Helix-based select mode and its most common keybindings #301

Merged
merged 6 commits into from
Jun 15, 2023

Conversation

gouegd
Copy link
Contributor

@gouegd gouegd commented Jun 12, 2023

Related to #299

This adds helix select mode inspired keybindings.
The just reuse existing commands and are defined as helix: select as opposed to existing other modes such as kakoune: normal etc. As far as I know, the kakoune or helix part of the string is not used yet, but this could be useful in the future.

By default, no keybinding is assigned to enter the new select mode from normal mode. Users need to assign one themselves (I assigned v to mine as Helix does, which is already used in dance/kakoune). Or they can just enter it via the VSCode command selection.

Available commands in this mode are esc (return to normal mode), u s+u undo/redo (same as normal mode), the selection changers: h j k l moves (and left down up right arrow keys), w W e E word moves, t T f F seeks, and g.

It's pretty much the same as the normal mode when combining shift with any of these keys. Instead of shift, you hit v (or whatever you manually assigned) then make your selection by combining any of the keys mentioned, then return to normal mode with esc to then possibly act on your selection (or directly use d or c, now handled from the select mode too)

Note: this would be a breaking change for any user who defined their own "select" mode, as I don't think there's any kind of namespacing enforced for modes at this point.

@gouegd gouegd changed the title Add Helix-based select mode and its most common keybindings feat: add Helix-based select mode and its most common keybindings Jun 12, 2023
@71
Copy link
Owner

71 commented Jun 12, 2023

Sweet, thanks! Looks good but I'll try to use it a little before submitting. My main concern is that these keybindings are part of Dance and might "bloat" the package (+475 lines just for package.json), but right now there is no alternative and there is some interest for Helix keybindings so this shouldn't be a big deal anyway.

@gouegd
Copy link
Contributor Author

gouegd commented Jun 14, 2023

Sweet, thanks! Looks good but I'll try to use it a little before submitting. My main concern is that these keybindings are part of Dance and might "bloat" the package (+475 lines just for package.json), but right now there is no alternative and there is some interest for Helix keybindings so this shouldn't be a big deal anyway.

that's true. The one thing I can think of is that dance would have several build modes, i.e. one for dance classic, one for kakoune, one for helix. And then from each of these builds, push a different VS Code extension: dance classic (the current build and extension), dance helix edition, dance kakoune edition.

@71
Copy link
Owner

71 commented Jun 15, 2023

I thought about that, but a lot of extensions would be needed so I'd prefer having extensions that import Dance and add keybindings, but AFAIK they couldn't add some configuration, e.g. new modes. That's not really a problem, but I would still rather have everything in a single Dance extension.

@71 71 merged commit 63dd82d into 71:master Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants