question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discussion] Overriding the `type` command

See original GitHub issue

Issue Description

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 Normal to Insert.

Any thoughts on such a change? Any obvious drawbacks or improvements?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
nikoladscommented, Jun 17, 2020

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 и.

1reaction
yuchenshicommented, Apr 3, 2020

I’m all for this change for the flexibility. Two additional problems I think we can tackle with global type override:

  1. 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.
  2. Right now it’s super tricky to remap g d to go to definition – adding a new key sequence binding in VSCode will make g wait on the next key instead of open the go to menu in Dance. I think global type will enable Dance to implement a Kak-like configurable “mode” for this.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Overriding the default 'type' command and then calling the ...
Steps to Reproduce: Override the 'type' command with vscode.commands.registerCommand; Call the default 'type' command instead of the custom ...
Read more >
Overriding in Java - GeeksforGeeks
Overridden methods allow us to call methods of any of the derived classes without even knowing the type of derived class object. When...
Read more >
override specifier (since C++11) - cppreference.com
In a member function declaration or definition, override specifier ensures that the function is virtual and is overriding a virtual function ...
Read more >
How to override option in aliased command? [duplicate]
With rm , -f overrides -i if it comes later on the command line ...
Read more >
Override Artisan commands? - Laracasts
And that will take precedence over the built in down command. Just change the command binding to whatever command you want to override....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found