question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

visualModeKeyBindingsNonRecursive and visualModeKeyBindings don't work for first key pressed after visual mode is entered

See original GitHub issue

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:

"vim.visualModeKeyBindingsNonRecursive": [
  { "before": "n", "after": "j" }
],

With this config if you type vnn the first n acts as if n hasn’t been remapped to j and jumps to the “next match”. After this n works as expected (so the second n there cause a down movement). I can also do:

v<left-arrow>n and then n will come out fine. So it’s only for the very first key-press after visual mode has been entered.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
jpooncommented, Feb 1, 2019

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 https://github.com/VSCodeVim/Vim/pull/3424 and with https://github.com/VSCodeVim/Vim/pull/3440, I’ll be adding some validation around the remap to ensure that a string array is used.

2reactions
insidewhycommented, Jun 20, 2018

@jpoon The minimal config to reproduce this is:

"vim.visualModeKeyBindingsNonRecursive": [
  { "before": "n", "after": "j" }
],

then just follow the instructions in the issue description.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is `vmap` for both Visual *and* Select mode?
Select mode is similar to Visual mode in some senses, but different in that when a printable character is typed, Vim will replace...
Read more >
How to use vim (key-bindings) with Visual Studio Code vim ...
Add the following to settings.json (open the Command Pallete and search for "User Settings"): "vim.insertModeKeyBindings": [ { "before": ...
Read more >
Visual Studio Code: Keyboard not working Permanent FIX
This brings a fix to visual studio when you cannot use the editor because it's not getting the keyboard input. Common questionsIn my...
Read more >
CHANGELOG.md · rzzhuzhen/Vim - Gitee.com
Visual mode cannot be navigated with up/down arrow keys #5029; gJ doesn't work in visual mode #5027; Shortcut asterisk (wildcard) key ...
Read more >
Keymap - Helix
Accessed by typing Ctrl-w in normal mode. This layer is similar to Vim keybindings as Kakoune does not support window. Key, Description, Command....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found