Implements the enhancement requested in #24655 - enables tab switcher to show all open files across all panes deduped. It's called "follow mode" because whichever is the active pane is ALWAYS where the file, terminal, etc will be opened from the tab switcher (not married to this mode name). Adds `follow_mode: true` option to `tab_switcher::ToggleAll`. When enabled: - **Shows all tabs across panes** - Same file in multiple panes appears once (deduped by path) - **Opens in active pane** - Selecting a file opens it in current pane, creating independent editor instances - **Moves terminals** - Non-file items (terminals, multibuffers) move to current pane instead of duplicating - **Preview & restore** - Navigate with arrow keys / tab to preview, Escape restores original state Intended for vim/helix `:buffers` command workflow while respecting Zed's tab-based paradigm. ### Usage ```json ["tab_switcher::ToggleAll", {"follow_mode": true}] ``` ### Implementation **Preview pattern:** Clone item handles during navigation, clean up on dismiss - **Files**: Preview with cloned handle, confirm closes preview and opens fresh (independent editors) - **Terminals**: Preview with cloned handle, confirm removes from source (moves to current pane) **Key technical details:** - Ignore workspace events during follow mode to prevent list re-sorting from preview operations - Preserve preview tab status on confirm - Close operations remove from all panes in follow mode - Remove from source before activating to ensure correct focus management ### Test Coverage 21 tests total (14 new follow mode tests): - File behavior: deduplication, independent editors, preview status preservation, close behavior - Non-file behavior: terminal movement, focus management, single pane scenarios - General: MRU stability, restore on dismiss ### Release Notes - Added `follow_mode` option to `tab_switcher::ToggleAll` for vim-style buffer list showing all deduped open files across panes opening in active pane ## Q&A **Q: Why not tie this to vim mode?** A: This feature is different enough from vim/helix buffer behavior that I opted not to couple them. It is an approximation using Zed's tab switcher/picker and would take architectural changes to implement real vim/helix buffers. Additionally, both follow mode and regular tab switcher mode are useful window/tab management workflows that vim or non-vim users may want regardless of their editing mode preference. **Q: How to use this?** A: For a vim/helix-like workflow: 1. **Bind the follow mode tab switcher** - Add to your keymap: ```json { "context": "Workspace", "bindings": { "cmd-i": ["tab_switcher::ToggleAll", {"follow_mode": true}] } } ``` 2. **Hide the tab bar (optional)** - Add to settings: ```json { "tab_bar": { "show": false } } ``` 3. **Move tabs to other pane on close (optional)** - Add to your keymap to join tabs into next pane when closing: ```json { "context": "Pane", "bindings": { "cmd-w": "pane::JoinIntoNext" } } ``` This makes closing a tab behave more like vim's split closure - items move to the adjacent pane instead of being closed. If you find that you'd rather have the tab bar visible, there's a pretty good chance you don't need/want this feature. Vim/helix don't have visible tab bars, so this feature is primarily for users who want that sort of experience where buffers are not tied to a specific split/pane and closing a split does not impact the available buffers. ## Future Work A few additional features could make for more complete vim/helix-like buffer workflow: **`:bd` (buffer delete) improvements:** - Should close the buffer from ALL panes, not just the current one - Current implementation: `workspace::CloseActiveItem` only closes in current pane - Needed: New action like `workspace::CloseActiveItemAcrossPanes` and/or update vim command mapping **`:q` (quit) improvements:** - Should close the split/pane while preserving its tabs - Behavior: merge tabs into next pane (like `pane::JoinIntoNext`), unless it's the last pane - Last pane: close the pane and all its items - Current implementation: `workspace::CloseActiveItem` closes active item, not the pane - Needed: New action or pane closure logic that moves tabs before closing These are complementary to this feature and can be done as separate PRs. Release Notes: - Add `tab_switcher::ToggleUnique` to allow a more vim-like tab switching experience.
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.