Vim
Vim copied to clipboard
Map Vim Keyboard Shortcut to VS Code Command (e.g. map 'leader'+'key' to any given VS Code shortcut)
Does this issue occur when all extensions are disabled?: Yes
VS Code Version: 1.66.0 OS Version: Monterey 12.2.1 Bug: Currently, VS Code does not enable you to map a Vim keymap to a Jupyter extension command. (specifically, execSelectionInteractive).
Steps to Reproduce:
Install VS Code vim extension Add the below to settings.json "vim.leader": "", "vim.normalModeKeyBindings": [ { "before": [ "", "e" ], "after": [], "commands": [ { "command": "jupyter.execSelectionInteractive", "when": "editorTextFocus", "args": [] } ] } ], "vim.visualModeKeyBindings": [ { "before": [ "", "e" ], "after": [], "commands": [ { "command": "jupyter.execSelectionInteractive", "when": "editorTextFocus", "args": [] } ] }] Notice that pressing the ["","e"] combination does not send the code to be executed in the interactive terminal. Notes to the above big:
Changing the "before" keymap, doesn't make a difference. (i.e. it's not down to an issue with the 'leader' mapping). Changing the "command" to read 'python.execSelectionInTerminal' DOES work. (so, the issue is with the JUPYTER extension command, and NOT other VSCode commands). Changing the keymap for "jupyter.execSelectionInteractive" from the usual "shift+enter" in the "Keyboard Shortcuts" page of VSCode to something like "cmd+enter" (or anything), also DOES work. So, it IS possible to remap a keyboard shortcut for the command from the VS Code Keyboard Shortcuts settings. Thus, we've isolated that the problem only arises when you try and do a VIM extension keymap (i.e. from the Settings.JSON page), to map to a Jupyter extension command. Fix: It would be great if you extended support such that users could map any of their vim keymaps to any commands currently mappable in the "Keyboard Shortcuts" section. This would have a positive impact on all users who already have a very comfortable Vim / eMacs set-up, and would like to move to VSCode (for all the added functionality), but are confronted with the very large barrier to entry as it's quite hard to port your already ingrained muscle memory over...
Thanks
Bump