Vim Normal Cursor Fix
Provides cursor commands intended for VSCodeVim normal-mode h/l/w/b/e/$/j/k mappings.
The commands still call VS Code's built-in cursor movement so block cursors are corrected around inlay hints.
Usage
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["h"],
"commands": ["vimNormalCursorFix.cursorLeft"]
},
{
"before": ["l"],
"commands": ["vimNormalCursorFix.cursorRight"]
},
{
"before": ["w"],
"commands": ["vimNormalCursorFix.cursorWordStartRight"]
},
{
"before": ["e"],
"commands": ["vimNormalCursorFix.cursorWordEndRight"]
},
{
"before": ["b"],
"commands": ["vimNormalCursorFix.cursorWordStartLeft"]
},
{
"before": ["$"],
"commands": ["vimNormalCursorFix.cursorLineEnd"]
},
{
"before": ["j"],
"commands": ["vimNormalCursorFix.cursorDown"]
},
{
"before": ["k"],
"commands": ["vimNormalCursorFix.cursorUp"]
}
]
The commands clamp cursor movement to the current line:
vimNormalCursorFix.cursorLeft stops at column 0.
vimNormalCursorFix.cursorRight stops at the last normal-mode cursor position of the current line.
vimNormalCursorFix.cursorWordStartRight and vimNormalCursorFix.cursorWordStartLeft keep VS Code's cross-line word motion and clamp line-end positions back to the last character.
vimNormalCursorFix.cursorWordEndRight implements a Vim-style e motion, then applies the same inlay-hints cursor correction.
vimNormalCursorFix.cursorLineEnd, cursorDown, and cursorUp clamp to the last normal-mode character when needed. At line end, they move to the previous character and reuse the fixed cursorRight logic instead of a plain right-left nudge, which would overshoot at EOL.
Use the extension command names in VSCodeVim settings. Mapping directly to cursorLeft or cursorRight bypasses this extension.
Development
npm install
npm run compile
npm run package
npm run package builds vim-normal-cursor-fix-x.x.x.vsix.