Vim
Vim copied to clipboard
Pass count to the command called by remapper
Is your feature request related to a problem? Please describe. This is to solve https://github.com/VSpaceCode/VSpaceCode/issues/278.
When a user used vim.normalModeKeyBindingsNonRecursive to remap to a command,
- there's no way for an extension to integrate with the count information
- The count still persist after the command executed
For example:
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<space>"],
"commands": ["vspacecode.space"],
},
]
VSpaceCode has no way to get the count when a user press 2 <space>, and after the command has been executed the 2 still exists.
Describe the solution you'd like Is there any way we can pass the count (or more general the vim state) when we call the command?
For example:
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<space>"],
"commands": [
{"command": "whichkey.triggerKey", args: "$count"}
],
},
]
The remapper will inspect the args and replace $count with the count. This can also support other variables like $registers.
Describe alternatives you've considered
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<space>"],
"commands": [
{"commandWithVimState": "whichkey.triggerKey"}
],
},
]
When space is entered, it will pass vim state as parameter when executing command the vscode.commands.executeCommand(commandString, vimState).