VSCodeVim / VSCodeVim/Vim

Discussion: new way to do NavigateBack C-o: get VSCode command working

Open
#5,127 9 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/discussion
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

The are some issues around vim's /our C-o implementation, because it only works with one vscode code navigation command (goto Defintion), but not others:
#3990
#3052
We need until now an own command for vim, because workbench.action.navigateBack will record every cursor move:
#3989
There have been attempts (to record jumps from other commands) by people probably more skilled than me ;-) but it did not succeed.

My approach is to get workbench.action.navigateBack to work. Looks like we can do this. Vscode records our cursor movements by j/k because they come from an extension ( I read about that somewhere in vscode issues.). But if we use cursorUp and cursorDown for simple cursor movements, we can get a clean vscode jumplist.
Here is a demo (5 MB, mp4):
https://1drv.ms/u/s!Auamqfb9LjGpbEtF9NMvWkfEadc

It would be a small change to the code, basically: for j, k, up, down with count = 1, use vscodes commands.
Feedback?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the handling for j, k, up, and down motions and the existing C-o implementation, then inspect how workbench.action.navigateBack is invoked. Verify the proposed single-step cursor commands produce a clean VS Code jumplist without recording every cursor movement, and check the related issues #3990, #3052, and #3989 for constraints.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.