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.

Keybindings with Alt modifier.

See original GitHub issue

FEATURE REQUEST

I would like to be able to bind key sequences with alt to vim keys, specifically Alt + v to V like so:

{ "before": [ "alt+v" ], "after": [ "V" ], },

Would this be hard to implement ?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:14
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

21reactions
thisisrandycommented, Oct 18, 2019

+1 A common use case is A-j/A-k for moving lines. It’s annoying to have to use the arrow keys for this in VSCode, which has the same mapped to A-down/A-up. I poked around in the code for a bit trying to figure out where captured keys are defined, but I’ve spent too long at this point to want to do it on my own. Please reopen

12reactions
berknamcommented, Nov 20, 2020

The problem with binding to alt+... key combinations is that it would make those combinations stop working for their normal behavior and there is a lot of alt+... that are either used by default vscode commands or by other extensions.

If we bound to those key combos we would enter in conflict with the commands of those other extensions. This would happen even if the user wasn’t using those key combos for any remap.

It might be possible to only bind to those key combos when a remap that uses it is configured. But it would still conflict if there was the same key combo being used by another extension.

For now as a workaround for moving lines with <A-j> and <A-k> you can add this to your ‘keybindings.json’ file:

    {
        "key": "alt+j",
        "command": "editor.action.moveLinesDownAction",
        "when": "editorTextFocus && !editorReadonly && vim.active"
    },
    {
        "key": "alt+k",
        "command": "editor.action.moveLinesUpAction",
        "when": "editorTextFocus && !editorReadonly && vim.active"
    },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Keybind Modifiers : r/ffxiv
Alt, Ctrl and Shift are the only 3 choices for modifier keys. If you have trouble with hitting them i would suggest trying...
Read more >
Guide :: Keybinds with modifiers (Alt, Shift, etc.) and toggle ...
How to create keybinds with modifiers, such as pressing Alt, Shift or something else to modify the behavior of a key.
Read more >
Modifier Keys (GNU Emacs Manual)
The standard key bindings in Emacs do not include any characters with the Super and Hyper modifiers, and only a small number of...
Read more >
KeyBindings with ModifierKeys.Alt not working with right ...
In case of an Alt modifier, e.Key returns Key.System and the real key is in e.SystemKey. Code. Do you check whether KeyEventArgs ...
Read more >
Change the behavior of the modifier keys on Mac
Click Keyboard Shortcuts on the right, then select Modifier Keys in the list on the left. For each modifier whose default action you...
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