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.

Key mapped to leader can't be used as normal key in non-insert mode

See original GitHub issue
  • 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.16.1
  • VsCodeVim Version: 0.10.1
  • OS: OSX 10.12.1

What happened: In settings.json, I have my leader mapped to a comma:

vim.leader: ","

Whenever I try to use a comma when navigating (f, or dt,), searching for a comma (/,) or in visual mode when the comma is pressed it is not treated as a normal key but as the leader and awaits the second key or chord.

What did you expect to happen: The leader functionality should only be activated when pressed first in normal and visual mode. If it follows after anything else, or in search mode, it should treated as a normal key

How to reproduce it:

  • map a comma to the leader in user settings
  • go to any code and try to navigate to the closest comma (f, or t,) or try to search for a comma (/,)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gallorcommented, Oct 4, 2017

Well don’t I feel silly. 😃 I didn’t realize I needed to map those using the vim.otherModesKeyBindingsNonRecursive setting. Thanks

0reactions
xconvergecommented, Oct 4, 2017

These are the problem ones for you 😉 feel free to reopen if you continue to have issues

{
        "key": ", l",
        "command": "workbench.action.focusNextGroup",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
    {
        "key": ", h",
        "command": "workbench.action.focusPreviousGroup",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable the leader key in vim insert mode - Super User
vim . In this file you can put unmap commands. One of mine are iunmap <Leader>is which is a mapping from a.vim ...
Read more >
A scenario where using the space bar as a leader causes ...
<Leader> mappings are usually for normal mode commands not insert modes. It's not a good idea to map typable keys in Insert mode...
Read more >
I have not heard any good argument for a leader key better ...
I set to use space as the leader key only on normal mode so there's no lag. ... custom mapping's in insert mode,...
Read more >
Leaders - Learn Vimscript the Hard Way
Mapping Key Sequences ... Try them out by typing -d and -c (quickly) in normal mode. The first creates a custom mapping to...
Read more >
Vim: <leader> key sequences are interfused with normal ...
When I open *.cpp file only one of the mappings works as expected: the ",t" sequence makes the "echo" happen, but the other...
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