Cannot make a key binding for Shift+Enter (normalModeKeyBindingsNonRecursive)
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'm trying to remap <Enter> and <Shift>+<Enter> to create new lines in Vim normal mode.
<Enter> works as intended, but <Shift>+<Enter> doesn't work. Here's the relevant setting.json:
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<Enter>"],
"commands": ["editor.action.insertLineAfter"]
},
{
"before": ["<Shift>", "<Enter>"],
"commands": ["editor.action.insertLineBefore"]
}
],
I've tried other strings like <S-CR>, which don't work either. What am I missing?
(I've also disabled all Keyboard Shortcuts that use shift+enter.)
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.16.0
- VSCode version: 1.47.3
- OS: macOS 10.15.6
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 setting.json configuration using vim.normalModeKeyBindingsNonRecursive in VSCodeVim, with the and + mappings shown. Trace the keybinding entry point and compare the handling of these sequences; done means Shift+Enter invokes editor.action.insertLineBefore while Enter continues to invoke editor.action.insertLineAfter.
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
- Mostly clear
- Newbie friendliness
- 35/100