While mapping jk/jj to esc, typing j and a motion hotkey make the j appear after the motion.
@berknam is already working on this.
Since Dec 9, 2020.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
I have imapped jk to <ESC>, and have some hotkeys like ctrl+a mapped to command cursorHome, ctrl+b to cursorLeft.
Press j and then ctrl+a, the j appears at the start of the line.
That is, the j changes its original location to the location after motion hotkey.
IIRC I don't remember such problem exists before.
To Reproduce
- add the following lines to user settings.
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["j", "k"],
"after": ["<esc>"]
}
],
add such hotkeys to keybindings.json
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Insert'"
},
{
"key": "ctrl+a",
"command": "cursorHome",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Insert'"
},
{
"key": "ctrl+p",
"command": "cursorUp",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Insert'"
},
{
"key": "ctrl+n",
"command": "cursorDown",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode == 'Insert'"
},
- Say we have a line
println($)($ is where the cursor now at)
press j and it becomesprintln(j$)and waiting for a key.
Then pressctrl+eto move to end of the line.
The line becomesprintln()j$
The j changes its location.
Other such hotkeys(ctrl+a,ctrl+p, etc.) all behave like this.
Expected behavior
The line becomes println(j)$ ($ is where the cursor now at) but not println()j$.
I remember I used to play around with the variable j without any problem.
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.17.1
- VSCode version: 1.49.2
- OS: Version 2004 (OS Build 19041.264)
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.
Assessment
This issue has not been assessed yet.