[Discussion] Overriding the `type` commandSee original GitHub issue
I’ve been thinking about a few features that could be added to Dance, but that would require the VS Code
type command to be overridden at all times (rather than only when awaiting user input after a specific command, like now).
One such feature would be to map commands to characters, rather than key combinations, which would help for supporting non-Qwerty keyboard layouts. It could also allow custom commands in normal mode down the line, without having to modify the particularly verbose VS Code keybindings. I haven’t tested it, but I also think it would slightly decrease the time when switching from
Any thoughts on such a change? Any obvious drawbacks or improvements?
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Mapping commands to characters, rather than key codes, will be a problem for people who use multiple keyboard layouts.
I use both Bulgarian and English keyboard layout. Sometimes I need to write some Bulgarian text in vscode. With key codes everything works fine, because they are the same across layouts.
However if characters are used then all normal mode commands will stop working in Bulgarian layout, because pressing keys will produce Cyrillic characters. For example pressing
i will produce
I’m all for this change for the flexibility. Two additional problems I think we can tackle with global
- In normal mode, I sometimes fat finger and hit keys that are unmapped (or not yet implemented by Dance). I would expect those things to give me a warning and leave the buffer unchanged (like Kakoune) but right now it messes up the buffer (especially with a selection) and I have to figure out how to undo.
- Right now it’s super tricky to remap
g dto go to definition – adding a new key sequence binding in VSCode will make
gwait on the next key instead of open the
go tomenu in Dance. I think global
typewill enable Dance to implement a Kak-like configurable “mode” for this.