Vim: Unable to use key <leader> bound to in otherModesKeyBindingsNonRecursive

Created on 12 Jul 2017  ·  9Comments  ·  Source: VSCodeVim/Vim

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

BUG REPORT

Environment:

  • VSCode Version: 1.14.0
  • VsCodeVim Version: 0.9.0
  • OS: Windows 10 x64

What happened:
With the example line of text (cursor at the |) and the Settings.json fragment shown below the key combination f<space>;;,, leaves the cursor between "a" and "sentence" instead of "is" and "a".

|this is a sentence.

    "vim.leader": ",",
    "vim.otherModesKeyBindingsNonRecursive": [
        { "before": ["<leader>", "<leader>"], "after": [","] }
    ],

What did you expect to happen:
The cursor should be between "is" and "a".

kinquestion

Most helpful comment

Im experiencing similar problems, or maybe is the same exact problem, since I don't fully understand what is happening.

In my case I have mapped leader key to space, and I want to use leader w to save, but this is not working. I am also using otherModesKeyBindingsNonRecursive.

Thanks

All 9 comments

Im experiencing similar problems, or maybe is the same exact problem, since I don't fully understand what is happening.

In my case I have mapped leader key to space, and I want to use leader w to save, but this is not working. I am also using otherModesKeyBindingsNonRecursive.

Thanks

Recently this has broken completely. It appears otherModesKeyBindingsNonRecursive no longer works in any way. I have one command that just triggers on <space> even and now it doesn't work. This is all new breakage

    {
      "before": [
        "<space>"
      ],
      "after": [],
      "commands": [
        {
          "command": "editor.foldRecursively",
          "args": []
        }
      ]
    },

I'm on my phone but please see the changelog for v0.13.0. We removed othermodeskeybindings in leiu of splitting it into two other configs

@jpoon Ah, I see that now. Funny, I even quickly looked at the CHANGELOG but missed that (cause i searched otherModesKeyBindingsNonRecursive not otherModesKeyBindings. Changing to "vim.normalModeKeyBindings" fixed it for me. Thanks 👍

This is probably safe to close?

Seems like this has been resolved. Otherwise, take a look at https://github.com/VSCodeVim/Vim#debugging-remappings on how to debug remappings.

Still isn't working for me with the updated settings.json fragment below. I tried all three different normalModeKeyBindingsNonRecursive entries and have debug output for the first shown below.

{
    "vim.leader": ",",
    "vim.normalModeKeyBindingsNonRecursive": [
        { "before": ["<leader>", "<leader>"], "after": [","] }
        //{ "before": ["<leader>", ","], "after": [","] }
        //{ "before": [",", ","], "after": [","] }
    ],
}
[Extension Host] debug: ModeHandler: handling key=;.
console.ts:134 [Extension Host] debug: Remapper: find matching remap. keys=;. mode=Normal.
console.ts:134 [Extension Host] debug: Remapper: normalModeKeyBindingsNonRecursive. loaded: before=,,,. after=,. 
console.ts:134 [Extension Host] debug: Remapper: find matching remap. keys=;. mode=Normal.
console.ts:134 [Extension Host] debug: ModeHandler: handling key=,.
console.ts:134 [Extension Host] debug: Remapper: find matching remap. keys=,. mode=Normal.
console.ts:134 [Extension Host] debug: Remapper: normalModeKeyBindingsNonRecursive. loaded: before=,,,. after=,. 
console.ts:134 [Extension Host] debug: Remapper: find matching remap. keys=,. mode=Normal.
console.ts:134 [Extension Host] debug: ModeHandler: handling key=,.
console.ts:134 [Extension Host] debug: Remapper: find matching remap. keys=,,,. mode=Normal.
console.ts:134 [Extension Host] debug: Remapper: normalModeKeyBindingsNonRecursive. loaded: before=,,,. after=,. 
console.ts:134 [Extension Host] debug: Remapper: find matching remap. keys=,,,. mode=Normal.
console.ts:134 [Extension Host] debug: Remapper: normalModeKeyBindingsNonRecursive. match found. before=,,,. after=,. command=undefined.
console.ts:134 [Extension Host] debug: ModeHandler: handling key=,.

Did you try "vim.normalModeKeyBindings”?

@danawoodman Same result with "vim.normalModeKeyBindings", the mapping doesn't work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefanoio picture stefanoio  ·  3Comments

gerardmrk picture gerardmrk  ·  3Comments

jaredly picture jaredly  ·  3Comments

spinningarrow picture spinningarrow  ·  3Comments

ACollectionOfAtoms picture ACollectionOfAtoms  ·  3Comments