zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
45.73k stars 2.52k forks source link

Emulate the tag stack in Vim mode #14206

Open uob-hillmu opened 1 month ago

uob-hillmu commented 1 month ago

Check for existing issues

Describe the feature

In Vim, hitting ctrl-] takes you to the function definition. This part already seems to be implemented in Zed.

Each subsequent ctrl-] takes you to the corresponding definition, and maintains a stack of where you've been. Hitting ctrl-t pops the most recent off the stack, and takes you back one step.

This is a very handy way of navigating through multiple function calls in a codebase. ctrl-t seems to be currently set to editor::Transpose - is there an action I can set it to that would replicate this behaviour?

See https://vimdoc.sourceforge.net/htmldoc/tagsrch.html for documentation of the Vim behaviour.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

ConradIrwin commented 1 month ago

Not yet. We could bind ctrl-t to pane::GoBack, but that's really the jump list not the tag stack.

If you wanted to pair on this: https://calendly.com/conradirwin/pairing

theodoregoetz commented 1 week ago

This is the one missing feature that is keeping two of my coworkers from switching from vim to zed. Though I'm mostly happy with zed, a proper "tag stack" which we could pop out of (avoiding all the wandering associated with the existing "GoBack" feature) would be tremendously helpful for large code bases.

rms7326 commented 5 days ago

It may seem like a trivial feature but having the "skewered tagging" feature is what keeps me sane when deeply exploring code. As I dig deeper into source code it is common for me to wander around a bit when deciding where to dive deeper. When I want to return, I get terribly lost if I can't jump right back to the location where I tagged in. I am not aware of any editor or IDE that provides this valuable VIM feature. I really hope it is implemented with Zed.