normal mode keybindings isn't working.
I am trying to bind keys using leader key. I added :vsplit in Normal mode and insert mode for testing. The binding is working in insert mode but not working in the normal mode.
"vim.leader": "<Space>",
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["leader", "v"],
"commands": [":vsplit"]
}
],
"vim.insertModeKeyBindings": [
{
"before": ["leader", "v"],
"commands": [":vsplit"]
},
],
- Extension (VsCodeVim) version: 1.29.0
- VSCode version: 1.99.3
- OS: Windows 10
Please note my code base is in a remote machine running Ubuntu 22.04.5. I am using ssh on windows VSCode.
Can you please help?
Your formatting is a bit odd. Not sure if it's a parsing issue, but unlikely to be. Wouldn't hurt running a formatter over your settings.json (backup first)
when you say "leader" in the configuration, its supposed to be "
you should use <leader> instead of leader in your "before" because leader is a special key
I was struggling with this problem as well.
A specific piece of code in my keybindings.json file was interfering with the functionality of the space key. Instead of being interpreted as the leader key, it was being processed by VSCode. So I looked for all instances and commented them out.
// {
// "key": "space d",
// "command": "extension.vim_ctrl+d",
// "when": "editorTextFocus && vim.active && vim.use<C-f> && !inDebugRepl && vim.mode != 'Insert'"
// },
Additionally, I have defined the leader key in my settings.json as follows:
"vim.leader": "<space>",
The commands that utilize the leader key are set up like this:
{
"before": ["<leader>", "v"],
"commands": ["workbench.action.splitEditorRight"]
},
Otherwise, maybe someone in #4899 has another solution for you