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.
I've set the following as I like to work with word wrap enabled:
"vim.otherModesKeyBindingsNonRecursive": [
{
"before": ["j"],
"after": ["g", "j"]
},
{
"before": ["k"],
"after": ["g", "k"]
}
]
I noticed a discrepancy in behaviour for lines without wrapping. As you navigate between lines of varying length the cursor position doesn't keep its horizontal position.
The following GIFs just show motion using j and k.
I would expect both GIFs to show the same thing regardless if the gj and gk mappings are applied.
Expected behaviour (the keybinding mappings not applied):

Current behaviour (the keybinding mappings applied):

copying comment from dupe ticket linked:
This is a tough one
I couldn't figure out a way to get the start and end column positions of the wrapped line.
I tried this:
const posLine = vimState.editor.selection.active.line;
await vscode.commands.executeCommand("cursorMove", {
to: "wrappedLineStart"
});
const startCol = vimState.editor.selection.active.character;
await vscode.commands.executeCommand("cursorMove", {
to: "wrappedLineEnd"
});
const endCol = vimState.editor.selection.active.character;
const lineLength = endCol - startCol;
vimState.cursorPosition =
new Position(posLine, Math.min(lineLength + startCol, vimState.desiredColumn + startCol));
but moving the cursor 3 times for every 1 time we want to move it makes no sense from a performance standpoint.
I think that we need to get wrappedLine info via the vscode API but I could not find it currently...
Then we could skip using cursor move and do the same sort of moves we do as j and k, however we would use the wrappedLine start and end column instead of 0 and end of line
New user here having this issue. I had trouble following this issue since it was spread across a several of PRs/Issues so I might just be misunderstanding, but as far as I can tell it looks like it was supposed to have been fixed in May with https://github.com/VSCodeVim/Vim/pull/1552
I'm not intending to do anything with folding, but trying to get my j => gj/k => gk shortcuts working I've enabled "vim.foldfix": true which that PR suggested.
I'm still seeing the initial behavior where cursor position isn't retained (as seen in the gifs above).
Am I missing something?
@jessejanderson "vim.foldfix": true makes my cursor skip (as in touch a wrapped line) and then continue with the previous erroneous behavior. I was hoping that was what I was missing.
This still seems like an issue, If anyone has figured out a configuration which works I'm all 馃憘.
VSCode - 1.24.1
VSCodeVim - 0.13.0
I also have this issue. Would love to see a solution, or any form of workaround!
I don't know if it's related, but when moving a number of lines using j or k as in 15j or 15k, the initial column position isn't remembered either.
For me it's an issue when moving to/from a line that spans more than row.
This remains an isse even with "vim.foldfix": true, VSCode 1.29.1, and VSCode Vim 0.16.14. Does someone have another workaround?
Still an issue for me, as well.
Still an issue.
@J-Fields what vscode version will we see your fix in?
@rightaway Please see https://github.com/VSCodeVim/Vim/pull/4127
Most helpful comment
New user here having this issue. I had trouble following this issue since it was spread across a several of PRs/Issues so I might just be misunderstanding, but as far as I can tell it looks like it was supposed to have been fixed in May with https://github.com/VSCodeVim/Vim/pull/1552
I'm not intending to do anything with folding, but trying to get my
j => gj/k => gkshortcuts working I've enabled"vim.foldfix": truewhich that PR suggested.I'm still seeing the initial behavior where cursor position isn't retained (as seen in the gifs above).
Am I missing something?