-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
visualModeKeyBindingsNonRecursive and visualModeKeyBindings don't work for first key pressed after visual mode is entered #2233
Comments
BTW this only affects
|
Since vscodevim 0.13 the mappings are now handled via the |
Can you share the configurations you are using? |
@jpoon here's mine: "vim.insertModeKeyBindings": [
{
"before": [
"k",
"j"
],
"after": [
"<Esc>"
]
}
],
"vim.visualModeKeyBindings": [
{
"before": [
"<space>"
],
"commands": [
{
"command": "workbench.action.toggleZenMode",
"args": []
}
]
},
{
"before": [
"H"
],
"after": [
"^"
]
},
{
"before": [
"J"
],
"after": [
"G"
]
},
{
"before": [
"L"
],
"after": [
"$"
]
},
{
"before": [
"K"
],
"after": [
"g",
"g"
]
},
{
"before": [
"Tab"
],
"after": [
"%"
]
}
],
"vim.normalModeKeyBindings": [
{
"before": [
"U"
],
"after": [
"<ctrl+r>",
]
},
{
"before": [
"<space>"
],
"commands": [
{
"command": "workbench.action.toggleZenMode",
"args": []
}
]
},
{
"before": [
"H"
],
"after": [
"^"
]
},
{
"before": [
"J"
],
"after": [
"G"
]
},
{
"before": [
"L"
],
"after": [
"$"
]
},
{
"before": [
"K"
],
"after": [
"g",
"g"
]
},
{
"before": [
"tab"
],
"after": [
"%"
]
}
], |
@jpoon The minimal config to reproduce this is: "vim.visualModeKeyBindingsNonRecursive": [
{ "before": "n", "after": "j" }
], then just follow the instructions in the issue description. |
I fixed a couple of issues with the remapper (#3424, #3418), can you retry on the latest release (v1.0.4)? If it still doesn't work, can you share the debug output? @ohjames: that config is incorrect, it should be a string array.
With the above configuration, it works. However, we require that the remap matches precisely the keys inputted (https://github.com/VSCodeVim/Vim/blob/master/src/configuration/remapper.ts#L202). IOW, for this to work, you'll need to press: |
Although it may not be related, shortening the value of timeout like I defined the following mapping, "vim.visualModeKeyBindingsNonRecursive": [
{
"before": ["v"],
"after": ["$", "h"]
}
], and it did not work well with Reproduction procedure
|
Yep, thanks for pointing that out @hioki-daichi. After doing a bit of research, this seems inline with the behaviour for vanilla vim. If that conclusion is incorrect, let me know. I think this issue was ultimately resolved with #3424 and with #3440, I'll be adding some validation around the remap to ensure that a string array is used. |
I'll check it out, in vim/neovim I can do v followed by n in less than a second and get the remapped n. I'll paste my configs. I dunno if the string syntax for configs worked or if I made a mistake when I wrote my config out. |
Hi, |
@jpoon this is not inline with vanilla vim/neovim, this issue should not have been closed. @sqlkoala crazy! Maybe this can lead to a proper fix. |
Having the same problem. The following works in normal mode but not in visual mode: {
"vim.normalModeKeyBindings": [
{
"before": ["-"],
"after": ["$"]
},
],
"vim.visualModeKeyBindings": [
{
"before": ["-"],
"after": ["$"]
},
],
} |
I still don't get why this is closed, neovim and vim aren't like this at all. |
why is this closed? clearly this bug is not fixed.. u cant bind to more than one key in visual mode
will not work binding to more than 1 key is normal vim behavior but not this plugin |
@slier81 It's closed because @jpoon said:
Well it was not inline with vim behaviour and the conclusion was incorrect. We let him know and he didn't reopen the ticket. |
@insidewhy The problem stated in this issue has been fixed in the last version '1.15.0'.
@slier81 This is a different issue and will be fixed when #4735 gets merged. |
Thanks for the info. I went back to neovim because there wasn't any way to get this plugin to work well with a colemak keyboard layout, and due to the undo handling bugs. I'll try it again someday. |
After PR #4735 gets merged it should be possible to work with colemak keyboards. That PR will also introduce operator-pending mode remaps. |
@berknam That looks promising, thanks for the info. |
Colemak users remap hjkl to snei (as hjkl are in ridiculous places using our keyboard layout).
Here is a config representing how we remap the
n
key and can be used to reproduce this issue using the subsequent steps:With this config if you type
vnn
the firstn
acts as ifn
hasn't been remapped toj
and jumps to the "next match". After thisn
works as expected (so the secondn
there cause a down movement). I can also do:v<left-arrow>n
and thenn
will come out fine. So it's only for the very first key-press after visual mode has been entered.The text was updated successfully, but these errors were encountered: