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

bindings defined via vim.normalModeKeyBindingsNonRecursive that start with comma do not work #3171

Closed
insidewhy opened this issue Oct 27, 2018 · 6 comments · Fixed by #4735
Closed

Comments

@insidewhy
Copy link
Contributor

insidewhy commented Oct 27, 2018

Describe the bug

Adding the following to normalModeKeyBindingsNonRecursive works fine:

    {                                                                                                                                              
      "before": ["Z", "a"],                                                                                                                        
      "after": [],                                                                                                                                 
      "commands": [                                                                                                                                
        {                                                                                                                                          
          "command": "workbench.action.quickOpen",                                                                                                 
          "args": []                                                                                                                               
        }                                                                                                                                          
      ]                                                                                                                                            
    },       

However if you replace the "Z" with a "," then the key binding won't work.

@insidewhy insidewhy changed the title Cannot use comma key in key mapping Cannot make binding with comma key via vim.normalModeKeyBindingsNonRecursive Oct 27, 2018
@insidewhy insidewhy changed the title Cannot make binding with comma key via vim.normalModeKeyBindingsNonRecursive bindings with comma key defined via vim.normalModeKeyBindingsNonRecursive do not work Oct 27, 2018
@insidewhy insidewhy changed the title bindings with comma key defined via vim.normalModeKeyBindingsNonRecursive do not work bindings defined via vim.normalModeKeyBindingsNonRecursive that start with comma do not work Oct 27, 2018
@insidewhy
Copy link
Contributor Author

Weirdly ["Z", ","] works, only [",", "Z"] fails

@snaveevans
Copy link

snaveevans commented Nov 3, 2018

I have the same issue. I tried to set-up multiple commands with "," as the first key and none of them work.

"vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": [",", "w", "w"],
      "commands": [":wa"]
    },
    {
      "before": [",", "w", "q"],
      "commands": [":wq"]
    },
    {
      "before": [",", "w", "a"],
      "commands": [":wa"]
    },
    {
      "before": [",", "q", "q"],
      "commands": [":q"]
    }
]

Edit: Added Commands

@snaveevans
Copy link

I worked around this by changing my leader key to comma
"vim.leader": ","

@wdcew
Copy link

wdcew commented Mar 27, 2019

@snaveevans you can change "," to "<leader>"

@escorponox
Copy link

escorponox commented Jun 17, 2019

Same problem here with some log output:
#3565

[Extension Host] ModeHandler: debug: handling key=,.
[Extension Host] Remapper: debug: trying to find matching remap. keys=,. mode=Normal. keybindings=normalModeKeyBindingsMap.
[Extension Host] Remapper: debug: trying to find matching remap. keys=,. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
[Extension Host] Remapper: verbose: key=,. keySlice=,.
[Extension Host] ModeHandler: debug: handling key=w.
[Extension Host] Remapper: debug: trying to find matching remap. keys=w. mode=Normal. keybindings=normalModeKeyBindingsMap.
[Extension Host] Remapper: debug: trying to find matching remap. keys=w. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
[Extension Host] Remapper: verbose: key=w. keySlice=w.

@Kethku
Copy link

Kethku commented Aug 15, 2019

This is a bummer for me coming from spacemacs because I have muscle memory mapped to language specific features being prefixed with a comma.

This seems like a weirdly specific bug...

@berknam berknam mentioned this issue May 29, 2020
10 tasks
J-Fields pushed a commit that referenced this issue Aug 16, 2020
This is a pretty massive change; see pull request #4735 for full details

Most notably:
- Support for operator-pending mode, including remaps and a half-cursor decoration
- Correct handling of ambiguous remaps with timeout
- Correct handling of recursive special case when the RHS starts with the LHS
- Correct handling of multi-key remaps in insert mode
- Failed movements that occur partway through a remap stop & discard the rest of the remap
- Implement `unmap` and `mapclear` in .vimrc

Refs #463, refs #4908
Fixes #1261, fixes #1398, fixes #1579, fixes #1821, fixes #1835
Fixes #1870, fixes #1883, fixes #2041, fixes #2234, fixes #2466
Fixes #2897, fixes #2955, fixes #2975, fixes #3082, fixes #3086
Fixes #3171, fixes #3373, fixes #3413, fixes #3742, fixes #3768
Fixes #3988, fixes #4057, fixes #4118, fixes #4236, fixes #4353
Fixes #4464, fixes #4530, fixes #4532, fixes #4563, fixes #4674
Fixes #4756, fixes #4883, fixes #4928, fixes #4991, fixes #5016
Fixes #5057, fixes #5067, fixes #5084, fixes #5125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants