Mapping a single key (say 'q') to ESC in insert mode and then mapping keys sequence to 'q' switches vim to normal mode
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Please thumbs-up 👍 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.
What did you do?
In vim I map 'q' to ESC in insert mode, as it's easier to reach than ESC key. To be able to type 'q', I then map two 'z's to single 'q'. In vscode I configured it like this:
"vim.insertModeKeyBindingsNonRecursive": [{
"before": ["q"],
"after": ["<Esc>"]
},
{
"before": ["z", "z"],
"after": ["q"]
}
]
What did you expect to happen?
When I press 'z' twice in insert mode, a single 'q' character is printed.
What happened instead?
When I press 'z' twice in insert mode, vscode/vim switches to normal mode.
Technical details:
- VSCode Version: 1.9.1
- VsCodeVim Version: 0.5.3
- OS: Windows 10 Pro
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported insert-mode mappings from the issue in VSCodeVim using the supplied VS Code and extension versions. Trace how the mapped q output is processed versus a typed key, and consider the issue done when zz inserts q without switching to normal mode while the direct q mapping still produces Escape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100