Remapping keys to `<PageUp>` and `<PageDown>` does not work
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
I currently have J and K (uppercase) mapped to zz<PageDown>zz and zz<PageUp>zz respectively. In real vim this works fine, working like Page Down and Page Up while centering the cursor, serving as a natural way to page up and down while keeping both my hands on the home row of the keyboard. However, in this extension, all it does is put the cursor in the center of the screen. And if I change the binding to just <PageDown> or <PageUp>, it does nothing. So, there appears to be a bug where it silently ignores any instances of <PageDown> or <PageUp> in "after" for key bindings.
To Reproduce
Steps to reproduce the behavior:
- Open settings.json
- Add the following entry to
vim.normalModeKeyBindings:{"before": ["K"], "after": ["<PageUp>"]}and save. - Press Shift+K in normal mode.
- Observe how nothing happens.
Expected behavior
After making the above change to settings.json, Shift+K should work like Page Up.
Screenshots
N/A
Environment (please complete the following information):
{
"messages": [],
"activationTimes": {
"codeLoadingTime": 46,
"activateCallTime": 1,
"activateResolvedTime": 1,
"activationReason": {
"startup": true,
"extensionId": {
"value": "vscodevim.vim",
"_lower": "vscodevim.vim"
},
"activationEvent": "*"
}
},
"runtimeErrors": []
}
- Extension Version:
1.20.0 - OS Version:
Linux x64 5.11.10-arch1-1 - VSCode version:
1.54.3
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 with the settings.json entry under vim.normalModeKeyBindings and reproduce the reported Shift+K binding for or in normal mode. Trace how the extension handles the after key sequence, then verify that the mapping performs Page Up or Page Down rather than doing nothing or only centering the cursor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100