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
48.54k stars 2.9k forks source link

Commands for MRU-cycling tabs (Most Recently Used) #4971

Open jubr opened 1 year ago

jubr commented 1 year ago

Check for existing issues

Describe the feature

Since https://github.com/zed-industries/zed/issues/5244 (which can be closed) cycling tabs L+R has been implemented with pane::ActivateNextItem and pane::ActivatePrevItem.

But I'd like to request MRU-cycling through tabs, so I can quickly switch between non-adjacent tabs with cmd-tab and cmd-shift-tab. I often have a lot of files open, having to use the mouse to switch or performing 10 consecutive L or R operations is not efficient.

Basically how VSCode does it. Here's some pre-work describing the behavior hoping it can jump-start implementation:

Generic wishlist

These commands can then be bound to for instance:

"bindings": {
    "cmd-tab": "pane::ActivateMruPrevItem",
    "cmd-shift-tab": "pane::ActivateMruNextItem"
}

Some UI thoughts

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

image

faheemmughal commented 10 months ago

Cycling through MRU tabs are super critical to my workflow. IMO the only thing stopping me from switching to Zed right now.

joshuawarner32 commented 10 months ago

Big plus one to this: everything else about zed is great, but I just can't shake my muscle memory from other editors of ctrl+tab'ing in MRU order.

phwes commented 8 months ago

I am able to switch between most recently used tabs by adding this to my keymap.json:

{
    "context": "Pane",
    "bindings": {
      "ctrl-shift-tab": "pane::GoBack",
      "ctrl-tab": "pane::GoForward",
    }
}
jubr commented 8 months ago

Thanks for the suggestion, @phwes, this is close, but not exactly the de-facto MRU behavior I am looking for.

Looks like interest is rising for this feature: #4772 + (semi-related) #5620

phwes commented 7 months ago

Yes, you are right @jubr. On both accounts!

FlorianLoch commented 7 months ago

Too me this is most likely one of the most used binding at all. I got so used to it, that I really do not understand why very common browsers and even editors that target especially the fans of bindings do not have this...

Anyway, I would love to see it implement 👍

Moshyfawn commented 7 months ago

Related #8757

thuvasooriya commented 7 months ago

sorry if this is not relevant here, but how can I set the keybinding to switch to the next tab in zed vim mode.

Kerollmops commented 4 months ago

Hey @phwes 👋 I was very happy to, indeed, bind the ctrl-- and ctrl-_ on the ctrl-tab and ctrl-shift-tab binding like you propose because it is exactly what I want. However, it doesn't work and keeps the tab_switcher::Toggle 😢

Do you have an idea why?