Skip to content
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

Normal mode key binding for '0' make 0 not usable in command count #4339

Closed
Xdminsy opened this issue Dec 9, 2019 · 1 comment
Closed

Normal mode key binding for '0' make 0 not usable in command count #4339

Xdminsy opened this issue Dec 9, 2019 · 1 comment
Labels

Comments

@Xdminsy
Copy link

Xdminsy commented Dec 9, 2019

Describe the bug

I nnoremap 0 ^ in vim and it works perfectly. Because a command count won't start with a 0.
But in vscode, if I made such key binding, though if I only press 0 it works as expected, it makes preceding command count erroneous.
I mean, it makes 20G to be 2, cursorHome, and G, and guide me to line 2, this is not expected.
If i use "after": ["^"] instead of command of cursorHome, the 20G will be "2 times ^" and "G", well, even worse?
Let the number 0 in normal mode after a number still be 0, not mapped command.

To Reproduce

  1. Add
    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": ["0"],
            "commands": ["cursorHome"]
        },
    ]

to settings.json.

  1. Press 10G

Expected behavior
Like in vim,
Pressing 0 moves to line start,
Pressing 10G moves to line 10, not line 1

Environment:

  • Extension (VsCodeVim) version: 1.11.3
  • VSCode version: 1.40.2
  • OS: Windwos Version 1903 (OS Build 18362.356)
@J-Fields
Copy link
Member

J-Fields commented Dec 9, 2019

Duplicate of #4184

@J-Fields J-Fields marked this as a duplicate of #4184 Dec 9, 2019
@J-Fields J-Fields closed this as completed Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants