Problem
Many important shortcuts are mapped to Control Key in VSCode by default and at the same time, Control Keys play a important role in Vim Operations. I can't ditch control keys in favour of VSCodeVim or the other way also. I got this issue as I am moving from Mac to Linux where is no Command Key and Ctrl key like options.
Idea
So instead of completely relaying on Ctrl keys, Meta/Option keys can be used for Vim operations instead of control keys. Like for Example, Meta+s to split the editor instead of "Ctrl+s".
Alternatives
I tried to implement this myself but it seems like all shortcuts are hard coded in package.json. Besides, I couldn't understand the code due to lack of documentation. If this idea is not taken or seems useless, please just guide me where to start so that, I would implement it someday as per my need.
Additional Context
I got this problem while switching from Mac to Linux based OS (Debian). In Mac, Almost all VSCode
operations use Command Key and Control key is left unused. In that scenario, VsCodeVim taking full control over Ctrl Key seemed very very effective. I am not losing any functionality of vim and at the same time, all VSCode specific shortcuts are working via Command Key.
I got this issue as I am moving from Mac to Linux where is no Command Key and Ctrl key like options.
I haven't used a Linux machine in awhile, but I recall them understanding the Ctrl key. The documentation for VSCode also lists the same: https://code.visualstudio.com/docs/getstarted/keybindings#_accepted-keys
Like for Example, Meta+s to split the editor instead of "Ctrl+s".
I'm not really sure of a good way of doing this. At the moment, we don't bind to the meta keys which means we [vscodevim] does not get any notification of those key presses. For our keybindings see: https://github.com/VSCodeVim/Vim/blob/master/package.json#L141
Hi jpoon,
Actually, I made the required changes and got it working as I expected. You can find the changes here in the last commit.
https://github.com/vignesh0025/Vim/tree/MetaKeySupport
But I don't feel its the right way to do and so, I didn't create any pull request for the same. Kindly give your suggestion about the changes
I haven't used a Linux machine in awhile, but I recall them understanding the
Ctrlkey. The documentation for VSCode also lists the same: https://code.visualstudio.com/docs/getstarted/keybindings#_accepted-keysLinux machines understand Alt and Ctrl Key. Apart from that, Windows key is also understood as Meta Key which usually is mapped to system related functions like 'WinKey+L' to lock the screen
My use case is different, but I would love to be able to use the Meta/Super keys as a modifier for keybindings as well.
If I understood @vignesh0025 correctly, just binding Meta/Super and exposing it as a usable key would fix his issue as well, since VSCode can handle it, I was expecting to be able to use those for configuring vscodevim too.
I would like an option to use ALT instead of CTRL for vim keybindings, that way they wouldn't class with any vscode or my window manager bindings.
I've done this by rebinding one at a time, but I can imagine this would be a nice option for others.
Similar question, but is it possible to instead change the default VSCode "ctrl key" to a user customizable option? I like to map save from "ctrl-s" to "meta-s" on Linux as much as possible. It seems @vignesh0025 's change modifies the Vim mappings instead?
I've just moved from Mac to Linux for a new job.
VSCodeVim on a Mac was _particularly_ good because the common OS & VSCode combinations were on the Cmd key, leaving the Ctrl key mostly free for the Vim extension.
Now the common OS & VSCode combinations on Linux use Ctrl, there are lots of OS & VSCode <> Vim conflicts. There are very few existing Alt+[a-z] mappings in VSCode. So if VSCodeVim could have a setting to change its Ctrl mappings to Alt (similar to @vignesh0025's changes, but a user setting), that would solve those problems in one go. (OTOH you'd have different combinations to those in actual Vim, but that's a tradeoff)
Tangentially related: https://github.com/VSCodeVim/Vim/issues/2713
Thanks for the awesome extension!
Thanks for all the great efforts. 馃檹
Looking forward for the ability to binds Alt/Meta keys. Although <Leader>+<n^n> key would be enough for everyone for now.
My preferred rebind would be:
VSCodeVim: CTRL
VSCode: Shift-CTRL
i.e. All Vim CTRL commands use CTRL. All VSCode CTRL commands remapped to Shift-CTRL.
This should avoid clashing with existing bindings to Meta and Alt.
Most helpful comment
My use case is different, but I would love to be able to use the Meta/Super keys as a modifier for keybindings as well.
If I understood @vignesh0025 correctly, just binding Meta/Super and exposing it as a usable key would fix his issue as well, since VSCode can handle it, I was expecting to be able to use those for configuring vscodevim too.