VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.94k stars 1.32k forks source link

keep jumplist under tab / editor groups #8914

Open jangxyz opened 8 months ago

jangxyz commented 8 months ago

Is your feature request related to a problem? Please describe.

Vim jumplist (CTRL-O/CTRL-I) is great, I use it all the time. One frustration I get when using it in vscode is that it moves my cursor to other text editors that is open. This gets especially difficult when you have lot of tabs and editor groups open. Though I try to keep it to a small amount, I easily get around two editor groups (vsplits), each having 3~4 tabs.

As an example, say I want to keep focus on the left editor group, and keep the right group for reference files. However, by just referencing a file in the other group tangles the jump list, and moves my cursor to the right (or back at the left) as I type <CTRL-O>. This is not what happens in vim, where each window keeps its own jumplist. Splitting the window does not move the cursor around, and you get to keep focus on the current window.

My usage of jumplist was to jump inside a single file, or among different buffers(files) that was open in the window, typically by jumping to definitions and coming back.

Describe the solution you'd like

As stated above, I would like to have jumplist for each text editors in vscode, so I can have my cursor solely on that editor when I press CTRL-O/CTRL-I. If that breaks the current user experience, we can come up with a configuration to control the scope of the jumplist.

Describe alternatives you've considered

I don't know how we should organize the jumplist with the Tabs / Editor Groups problem, as the window UI for vscode is different from vim. In vim tab is the largest group which contains splits, so you have multiple split windows on a screen, but it all disappears when you go into another tab. Here tab represents the screen of windows you can work on. In vscode, tab is contained in the editor group(split), so you don't lose the information on screen when you move to another tab, at least the ones in the other editor group.

As this is a fundamental difference between vim and vscode, I imagine it would have some different behaviors/experience , but for now I can't come up with a solution for it.

Additional context

Here is a screenshot of Vim, having different jumplist for each window.

Screenshot1 - jumplist of left window Screenshot 2024-03-01 at 2 47 57 PM
Screenshot2 - jumplist of right window Screenshot 2024-03-01 at 2 48 08 PM
JasonXJ commented 2 months ago

Totally agree. With vim, I use ctrl-o/ctrl-i all the time. But with vscode, oftentimes it does not do what I want.