Skip to content

Provide "Go Last" navigation command. #33902

@brandonbloom

Description

@brandonbloom

@bpasero requested over in PR #33715 that I create this issue.

My goal is to implement a pair of related Vim "jump to mark" commands: VSCodeVim/Vim#1993

As far as I can tell, VSCode does not currently offer "marks" ("bookmarks"), but does have back/forward navigation history. In Vim, when you "jump" (navigate) anywhere, the specially named ' and ` "last jump" marks are set each time. The first time you press '' or ``, the experience is indistinguishable from "Navigate Back". However, that navigation is itself a jump, setting the special last jump marks. That means, if you press the key sequences again, you jump back to where you just came from. So pressing '' over and over will flip back and forth between two places. The ' register marks a line and the ` register marks a full position. The former can be implemented in terms of the latter.

While Vim implements this behavior in terms of marks, it's equally valid to implement it in terms of jumps, since the navigation history inherently includes cursor position information (ie anonymous marks). All that's necessary is a single variable storing one layer of additional navigation history: The last place you came from.

In practice, this feature works out something like alternating between "Go Back" and "Go Forward", letting you flip between to places quickly to compare them. This is frequently useful when comparing two places in one file, or when comparing places between files. Side-by-side comparisons are useful, but require more window manipulation to set up and tear down. "Go Last" enables quick overlay comparisons like flipping pages of a book back and forth.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions