Thanks for this plugin! So far it's much more flexible than the more popular vscode vim plugin.
I'm wondering, can I remap command key mappings?
Example:
nnoremap <D-j> 10j
Command + j moves down 10 lines. Are mappings like this possible?
yes, but for ctrl/meta/command keysequences you must additionally hint vscode to send this keysequence to neovim, as specified in the readme:
add to your keybindings.json
{
"command": "vscode-neovim.send",
"key": "command+j",
"when": "editorTextFocus && neovim.mode != insert",
"args": "<D-j>"
}
(actually i don't remember should cmd+j or command+j or ctrl+j be used for mac)
This way neovim will receive your D-j which can be used in any mapping
Thanks!
Sorry I missed that on my first read through. I didn't see any mention of the command key. Maybe this is the section in question: https://github.com/asvetliakov/vscode-neovim#to-pass-additional-ctrl-key-sequence-for-example--add-to-your-keybindingsjson
correct, this works for any complex key-sequence, not only for the ctrl.
Btw, feel free to reopen the issue if it doesn't work for you.
Thanks again! Yes, was going to close this out. If anyone else runs into this in the future, these mappings worked for me:
// keybindings.json
{
"command": "vscode-neovim.send",
"key": "cmd+j",
"when": "editorTextFocus && neovim.mode != insert",
"args": "<D-j>"
},
{
"command": "vscode-neovim.send",
"key": "cmd+k",
"when": "editorTextFocus && neovim.mode != insert",
"args": "<D-k>"
},
Most helpful comment
yes, but for ctrl/meta/command keysequences you must additionally hint vscode to send this keysequence to neovim, as specified in the readme:
add to your
keybindings.json(actually i don't remember should
cmd+jorcommand+jorctrl+jbe used for mac)This way neovim will receive your
D-jwhich can be used in any mapping