johtela / vscode-modaledit

Configurable Modal Editing in VS Code
https://johtela.github.io/vscode-modaledit/docs/README.html
Other
89 stars 8 forks source link

Text object in select mode #15

Closed louy2 closed 3 years ago

louy2 commented 4 years ago

I prefer a visual first workflow similar to Kakoune, so I want to select text objects in select mode. Unfortunately a and i are both bound, and it seems I cannot conditionally nest key bindings based on __selecting.

johtela commented 4 years ago

If I understand your request correctly, you would like to have different nested bindings for a key in normal mode and select mode. This feature is already implemented, but not yet released. I am working on a new major version with a lot of new features. One of them is separate selection mode bindings.

In the next version you can add a new configuration section modaledit.selectbindings which has the same structure as modaledit.bindings. Selection mode bindings have higher priority than normal mode bindings. I.e. when selection is active, normal mode binding is applied only if selection mode binding does not exist.

I hope to release the new version during this month. That version will also include Vim presets (#7) which serve as an example, how to use the new feature. I encountered the same problem when trying to emulate Vim's delete commands; when selection is active, d cuts the selected text to clipboard. But in normal mode (with no selection) d is bound to nested mapping that deletes lines (dd) words (dw) etc.

johtela commented 3 years ago

Implemented in version 2.0. See documentation for details.